Merge pull request #386 from Kathleen-Xu/fix/export_image

fix: the offset should not be multiplied by the scale
This commit is contained in:
pythongosssss
2024-11-07 20:33:02 +00:00
committed by GitHub
+1 -1
View File
@@ -54,7 +54,7 @@ class WorkflowImage {
app.canvas.ds.scale = 1;
app.canvas.canvas.width = (bounds[2] - bounds[0]) * scale;
app.canvas.canvas.height = (bounds[3] - bounds[1]) * scale;
app.canvas.ds.offset = [-bounds[0] * scale, -bounds[1] * scale];
app.canvas.ds.offset = [-bounds[0], -bounds[1]];
app.canvas.canvas.getContext("2d").setTransform(scale, 0, 0, scale, 0, 0);
}