Skip to content

Commit b6cb856

Browse files
committed
Fix add-line overlay
The origin for the line should be at x1, y1, but since the arguments to makeOverlayImage move the _background_ right and down, we need to reverse both. This will mean that the background goes left and up and the start of the line is at the right place.
1 parent 353206b commit b6cb856

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/js/trove/make-image.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@
818818
var color = unwrapColor(maybeC);
819819
var img = unwrapImage(maybeImg);
820820
var line = image.makeLineImage(x2 - x1, y2 - y1, color);
821-
return makeImage(image.makeOverlayImage(line, "left", "top", 0, 0, img, "left", "top"));
821+
return makeImage(image.makeOverlayImage(line, "left", "top", -x1, -y1, img, "left", "top"));
822822
});
823823

824824
f("scene-line", function(maybeImg, maybeX1, maybeY1, maybeX2, maybeY2, maybeC) {

0 commit comments

Comments
 (0)