-
Notifications
You must be signed in to change notification settings - Fork 6
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
Schedule a frame after markNeedsPaint is called #40
Schedule a frame after markNeedsPaint is called #40
Conversation
I think I prefer the other proposed change, because that change makes it clear what the problem is - there might not be another frame scheduled so we'll end up with a dangling dirty state. Also, instead of defining a new method, consider overriding |
@matthew-carroll Updated. |
lib/src/follower.dart
Outdated
void markNeedsPaint() { | ||
super.markNeedsPaint(); | ||
|
||
// Immediately schedule a new frame to avoid being in a dirty in the cases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This generally looks good, but can we get a bit more specific with the comment? I think most readers will wonder how it's possible that we mark ourselves dirty and yet a frame isn't scheduled on our behalf.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Do you think is it clear enough?
@angelosilvestre to remind myself of the status here, we ended up with you doing further investigation into the root cause, right? |
@matthew-carroll Yeah, I still need to figure out how to write a failing test using follow_the_leader only. |
@matthew-carroll As discussed, I modified this PR to only schedule a new frame when running in a test on Linux. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Schedule a frame after markNeedsPaint is called
Currently, we are calling
markNeedsPaint
directly when the follower layer transform changes.This is causing some
super_editor
golden tests to fail due to a crash in thecaptureImage
method called bymatchesGoldenFile
. This is the test failure output:This is the method that causes the crash:
An example of a failing test:
As an experiment, I tried to add
await tester.pumpAndSettle();
in the test before theexpectLater
, but the exception still happens.For some reason, the crash doesn't happen on mac.
This PR overrides
markNeedsPaint
to schedule a new frame.