Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds the ability to (continuously) request
AnimationFrame
pen events to render animations that are not strictly tied to other pen events.Animation
is added to the engine and used to ensure that only oneAnimationFrame
is in flight at a time.Things to Discuss
handle_pen_event
out of the engine and into the canvas, which is how it's currently done, or useEngineTask
s to make the engine call itself (currently commented). The former seems cleaner and likely faster, the latter allows us to get rid of the additionalEventResult
field and request animation frames from anywhere with access to the engine (i.e. also in the event handlers themselves).(EventPropagation, WidgetFlags, bool)
in thehandle_pen_event
functions.glib::source::idle_add_local_once
a different priority or use a different method. I just used what works on my machine and seems correct given my limited knowledge of the glib event loop.EDIT: Perhaps we could turn
request_animated_frame
into a field ofPenProgress::InProgress
. That would reduce the flexibility though.