Remove trait-specific draw logic in iced_native

This commit is contained in:
Héctor Ramón Jiménez 2021-10-14 16:07:22 +07:00
parent 3aae45c191
commit 03b3493138
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
71 changed files with 641 additions and 3126 deletions

View file

@ -5,10 +5,8 @@ use crate::{Settings, Transformation, Viewport};
use iced_graphics::backend;
use iced_graphics::font;
use iced_graphics::Layer;
use iced_graphics::Primitive;
use iced_graphics::{Layer, Primitive};
use iced_native::alignment;
use iced_native::mouse;
use iced_native::{Font, Size};
/// A [`glow`] graphics backend for [`iced`].
@ -47,13 +45,13 @@ impl Backend {
///
/// The text provided as overlay will be rendered on top of the primitives.
/// This is useful for rendering debug information.
pub fn draw<T: AsRef<str>>(
pub fn present<T: AsRef<str>>(
&mut self,
gl: &glow::Context,
primitive: &Primitive,
viewport: &Viewport,
(primitive, mouse_interaction): &(Primitive, mouse::Interaction),
overlay_text: &[T],
) -> mouse::Interaction {
) {
let viewport_size = viewport.physical_size();
let scale_factor = viewport.scale_factor() as f32;
let projection = viewport.projection();
@ -70,8 +68,6 @@ impl Backend {
viewport_size.height,
);
}
*mouse_interaction
}
fn flush(