Skip to content
Snippets Groups Projects
Commit fd604dfd authored by HJ's avatar HJ :fire:
Browse files

fixed still-image not preserving original aspect ratio and resolution.

parent eacbd9b5
No related branches found
No related tags found
1 merge request!324Another one of those MR that fixes many many small-to-medium things
......@@ -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)
}
}
}
......
......@@ -60,6 +60,7 @@
right: 0;
width: 100%;
height: 100%;
object-fit: contain;
}
}
</style>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment