aboutsummaryrefslogtreecommitdiff
path: root/src/components/still-image/still-image.js
diff options
context:
space:
mode:
authorkaniini <nenolod@gmail.com>2018-08-31 04:10:17 +0000
committerkaniini <nenolod@gmail.com>2018-08-31 04:10:17 +0000
commit958acbab8d43b7514369f4bc69bc2fe0353eddf2 (patch)
tree9c7b9d868f4b1cf8f0e592cdd607999d5484a18c /src/components/still-image/still-image.js
parent48391a45ba8924e20f280868bca78d77a32c3ddd (diff)
parent8c07e63f773a15119f3cf773c083fe3b76306c3f (diff)
Merge branch 'polish' into 'develop'
Another one of those MR that fixes many many small-to-medium things Closes #92, #75, #122, #52, #72, and #87 See merge request pleroma/pleroma-fe!324
Diffstat (limited to 'src/components/still-image/still-image.js')
-rw-r--r--src/components/still-image/still-image.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/components/still-image/still-image.js b/src/components/still-image/still-image.js
index 0839aca5..5ad06dc2 100644
--- a/src/components/still-image/still-image.js
+++ b/src/components/still-image/still-image.js
@@ -18,7 +18,11 @@ const StillImage = {
onLoad () {
const canvas = this.$refs.canvas
if (!canvas) return
- canvas.getContext('2d').drawImage(this.$refs.src, 1, 1, canvas.width, canvas.height)
+ const width = this.$refs.src.naturalWidth
+ const height = this.$refs.src.naturalHeight
+ canvas.width = width
+ canvas.height = height
+ canvas.getContext('2d').drawImage(this.$refs.src, 0, 0, width, height)
}
}
}