Implement revamped RedrawRequested on iOS. (#1299)
* Implement revamped `RedrawRequested` on iOS * Added RedrawEventsCleared to events_cleared logic * Fixed from comments * Added RedrawEventsCleared to draw_rect handler. * Fixed out of order `RedrawEventsCleared` events. * cargo fmt
This commit is contained in:
parent
133b11fa6d
commit
530ff5420b
2 changed files with 14 additions and 16 deletions
|
|
@ -102,10 +102,10 @@ unsafe fn get_view_class(root_view_class: &'static Class) -> &'static Class {
|
|||
unsafe {
|
||||
let window: id = msg_send![object, window];
|
||||
assert!(!window.is_null());
|
||||
app_state::handle_nonuser_event(Event::WindowEvent {
|
||||
window_id: RootWindowId(window.into()),
|
||||
event: WindowEvent::RedrawRequested,
|
||||
});
|
||||
app_state::handle_nonuser_events(
|
||||
std::iter::once(Event::RedrawRequested(RootWindowId(window.into())))
|
||||
.chain(std::iter::once(Event::RedrawEventsCleared)),
|
||||
);
|
||||
let superclass: &'static Class = msg_send![object, superclass];
|
||||
let () = msg_send![super(object, superclass), drawRect: rect];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue