Skip to content

Commit b5f5c03

Browse files
committed
try to fix add-line better.
As it turns out, if your line is in the "wrong direction", the previous code didn't work. You have to shift by the closest point to the origin.
1 parent b6cb856 commit b5f5c03

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", -x1, -y1, img, "left", "top"));
821+
return makeImage(image.makeOverlayImage(line, "left", "top", -Math.min(x1,x2), -Math.min(y1,y2), img, "left", "top"));
822822
});
823823

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

0 commit comments

Comments
 (0)