Remove trait-specific draw logic in iced_native
This commit is contained in:
parent
3aae45c191
commit
03b3493138
71 changed files with 641 additions and 3126 deletions
|
|
@ -1,5 +1,5 @@
|
|||
//! Create interactive, native cross-platform applications.
|
||||
use crate::{mouse, Error, Executor, Runtime};
|
||||
use crate::{Error, Executor, Runtime};
|
||||
|
||||
pub use iced_winit::Application;
|
||||
|
||||
|
|
@ -179,9 +179,8 @@ async fn run_instance<A, E, C>(
|
|||
&mut debug,
|
||||
));
|
||||
|
||||
let mut primitive =
|
||||
user_interface.draw(&mut renderer, state.cursor_position());
|
||||
let mut mouse_interaction = mouse::Interaction::default();
|
||||
// TODO
|
||||
// let mut mouse_interaction = mouse::Interaction::default();
|
||||
|
||||
let mut events = Vec::new();
|
||||
let mut messages = Vec::new();
|
||||
|
|
@ -246,8 +245,7 @@ async fn run_instance<A, E, C>(
|
|||
}
|
||||
|
||||
debug.draw_started();
|
||||
primitive =
|
||||
user_interface.draw(&mut renderer, state.cursor_position());
|
||||
user_interface.draw(&mut renderer, state.cursor_position());
|
||||
debug.draw_finished();
|
||||
|
||||
context.window().request_redraw();
|
||||
|
|
@ -291,8 +289,7 @@ async fn run_instance<A, E, C>(
|
|||
debug.layout_finished();
|
||||
|
||||
debug.draw_started();
|
||||
primitive = user_interface
|
||||
.draw(&mut renderer, state.cursor_position());
|
||||
user_interface.draw(&mut renderer, state.cursor_position());
|
||||
debug.draw_finished();
|
||||
|
||||
context.resize(glutin::dpi::PhysicalSize::new(
|
||||
|
|
@ -305,11 +302,10 @@ async fn run_instance<A, E, C>(
|
|||
viewport_version = current_viewport_version;
|
||||
}
|
||||
|
||||
let new_mouse_interaction = compositor.draw(
|
||||
compositor.present(
|
||||
&mut renderer,
|
||||
state.viewport(),
|
||||
state.background_color(),
|
||||
&primitive,
|
||||
&debug.overlay(),
|
||||
);
|
||||
|
||||
|
|
@ -317,14 +313,6 @@ async fn run_instance<A, E, C>(
|
|||
|
||||
debug.render_finished();
|
||||
|
||||
if new_mouse_interaction != mouse_interaction {
|
||||
context.window().set_cursor_icon(
|
||||
conversion::mouse_interaction(new_mouse_interaction),
|
||||
);
|
||||
|
||||
mouse_interaction = new_mouse_interaction;
|
||||
}
|
||||
|
||||
// TODO: Handle animations!
|
||||
// Maybe we can use `ControlFlow::WaitUntil` for this.
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue