-
Notifications
You must be signed in to change notification settings - Fork 116
Fix add-line overlay #1802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix add-line overlay #1802
Conversation
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.
Turns out this isn't good enough; still are counter-examples :) |
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.
I think this works the way I expect. It causes a crash with both negative x/y values on the command-line
|
Hrm save-image shouldn't crash with negative coordinates; we should choose which of two semantics to impose here:
Images shouldn't expose the fact that their coordinates might be negative |
Is this a problem that was created by |
It's probably a separate issue; we didn't even have save-image until recently, when we moved the image library into pyret-lang. But it's going to be exposed sooner than later in your usage, largely because of the way add-line might get used... |
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.
This fixes #1801.