-
Notifications
You must be signed in to change notification settings - Fork 137
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
Refactor ChangeFlags
and requests
#151
Conversation
src/window_handle.rs
Outdated
} | ||
|
||
self.set_cursor(); | ||
|
||
if !flags.is_empty() { | ||
if paint { |
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.
What if a view just wanted to request_paint without style or layout change, e.g. a canvas?
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.
They can just call request_paint
to do that.
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.
Ah I see it request_style
now. But is it efficient enough when the canvas wants some animation frames.
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.
It only requests style on one view, but I'm going to replace it to just requesting painting.
I've added some further changes here. Timers are no longer used for animations, which makes the The Paint requests no longer invokes the style pass. I've made |
Codecov Report
@@ Coverage Diff @@
## main #151 +/- ##
========================================
+ Coverage 5.17% 5.21% +0.04%
========================================
Files 56 56
Lines 10942 10850 -92
========================================
Hits 566 566
+ Misses 10376 10284 -92
📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
This refactors the use of
ChangeFlags
.ViewState
has a newrequested_changes: ChangeFlags
field which replacesrequest_layout
andrequest_style
.View::update
on longer returnsChangeFlags
as view implementation are expected to callrequest_*
functions.