iced-yoda/wgpu/src/renderer/row.rs

35 lines
996 B
Rust
Raw Normal View History

2019-10-05 19:22:51 +02:00
use crate::{Primitive, Renderer};
2019-10-11 23:30:53 +02:00
use iced_native::{row, Layout, MouseCursor, Point, Row};
2019-10-05 19:22:51 +02:00
impl row::Renderer for Renderer {
fn draw<Message>(
&mut self,
row: &Row<'_, Message, Self>,
layout: Layout<'_>,
cursor_position: Point,
) -> Self::Output {
2019-10-11 23:30:53 +02:00
let mut mouse_cursor = MouseCursor::OutOfBounds;
(
Primitive::Group {
primitives: row
.children
.iter()
.zip(layout.children())
.map(|(child, layout)| {
let (primitive, new_mouse_cursor) =
child.draw(self, layout, cursor_position);
if new_mouse_cursor > mouse_cursor {
mouse_cursor = new_mouse_cursor;
}
primitive
})
.collect(),
},
mouse_cursor,
)
2019-10-05 19:22:51 +02:00
}
}