Skip to content

Commit

Permalink
UI improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Linfindel committed Feb 16, 2024
1 parent c4ada0e commit c532a25
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,15 @@ function exportImage() {
const ctx = canvas.getContext("2d");

img.style.transition = "0s";
img.style.opacity = "0";
img.style.maxWidth = "";
img.style.maxHeight = "";

canvas.width = img.width;
canvas.height = img.height;

ctx.filter = window.getComputedStyle(img).getPropertyValue("filter");

const imgElement = new Image();
imgElement.src = img.src;
imgElement.crossOrigin = "anonymous";
Expand All @@ -354,6 +355,7 @@ function exportImage() {
const dataURI = canvas.toDataURL("image/jpeg");

img.style.transition = "0.25s ease";
img.style.opacity = "1";
img.style.maxWidth = "60vw";
img.style.maxHeight = "60vh";

Expand Down

0 comments on commit c532a25

Please sign in to comment.