diff options
| author | Henry Jameson <me@hjkos.com> | 2020-10-17 19:24:07 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2020-10-17 19:24:07 +0300 |
| commit | 29ff0be92cfd87ba95d1f78323794dfb1223b514 (patch) | |
| tree | 79836b7fb5b3e325274a833c34fd4c5f6155ba2d /src/components/still-image/still-image.js | |
| parent | a463959a365a5d618a79c96a26f6506e700d6ea3 (diff) | |
| parent | 3ca729d09880813420a263221cdc68bcca13a1fb (diff) | |
Merge remote-tracking branch 'origin/develop' into settings-changed
* origin/develop: (48 commits)
fix/leftover-emoji-checkboxes-in-settings
Apply 1 suggestion(s) to 1 file(s)
Translated using Weblate (Spanish)
Translated using Weblate (Persian)
Translated using Weblate (Persian)
Translated using Weblate (Polish)
update changelog
Stop click propagation when unhiding nsfw
Fix Follow Requests title style
Translated using Weblate (Persian)
Translated using Weblate (Persian)
Translated using Weblate (French)
Added translation using Weblate (Persian)
Translated using Weblate (Chinese (Traditional))
Translated using Weblate (Chinese (Simplified))
Translated using Weblate (Italian)
Translated using Weblate (English)
Translated using Weblate (English)
Translated using Weblate (Basque)
Translated using Weblate (Spanish)
...
Diffstat (limited to 'src/components/still-image/still-image.js')
| -rw-r--r-- | src/components/still-image/still-image.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/components/still-image/still-image.js b/src/components/still-image/still-image.js index ab40bbd7..8044e994 100644 --- a/src/components/still-image/still-image.js +++ b/src/components/still-image/still-image.js @@ -19,14 +19,16 @@ const StillImage = { }, methods: { onLoad () { - this.imageLoadHandler && this.imageLoadHandler(this.$refs.src) + const image = this.$refs.src + if (!image) return + this.imageLoadHandler && this.imageLoadHandler(image) const canvas = this.$refs.canvas if (!canvas) return - const width = this.$refs.src.naturalWidth - const height = this.$refs.src.naturalHeight + const width = image.naturalWidth + const height = image.naturalHeight canvas.width = width canvas.height = height - canvas.getContext('2d').drawImage(this.$refs.src, 0, 0, width, height) + canvas.getContext('2d').drawImage(image, 0, 0, width, height) }, onError () { this.imageLoadError && this.imageLoadError() |
