-
Notifications
You must be signed in to change notification settings - Fork 53
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
Set_Speed = "Instant" produces incorrect output #234
Comments
Could you tell me which Rust version ( This is definitely odd because setting the speed has nothing to do with how fills are calculated. It just affects how quickly the points are recorded. Does this still happen if the speed is very high (e.g. at 25)? |
@sunjay |
@sunjay |
Another thing I'd be curious to test is if it still happens if you set the IPC channel crate version to 0.14. We recently updated in #235 and this could happen if that crate is sending messages in the wrong order. (Sending messages in the wrong order shouldn't technically be possible because we always wait for a drawing to finish before sending the next one, but it's worth testing anyway just in case.) |
IPC channel is already in 0.14. I think #235 was merged 2 days ago. I never pulled from upstream after that. |
Ah okay. We can rule that out then. For anyone looking to work on this: I suggest printing out the messages being sent to the renderer process and making sure they are the same regardless of the speed. I also suggest printing out the display list and comparing at different speeds. Note that you don't need to run the entire example to debug this, just up to a portion of the drawing that appears different at different speeds. |
Right. That's good. Then the next place I'd look is whether the display lists are the same. |
The issue arises from the way MoveAnimation deals with Instant speed. More precisely, on line 126 below: turtle/src/renderer_server/animation.rs Lines 118 to 127 in c9918c4
we update fill polygon with old position (or current position before animation) instead of new or target position. sample code to reproduce: use turtle::Turtle;
fn main() {
let mut turtle = Turtle::new();
turtle.set_speed(x);
turtle.begin_fill();
for _ in 0..2 {
turtle.forward(200.0);
turtle.right(90.0);
}
turtle.end_fill();
}
|
While setting the turtle speed to "instant" I am seeing issues with the fill color.
Tried with
turtle.set_speed(Speed::instant());
turtle.set_speed("instant");
The text was updated successfully, but these errors were encountered: