summaryrefslogtreecommitdiffstats
path: root/wgpu/src/renderer/column.rs
blob: 1b9adad6e79eecb2276468ea96139afb058d65e6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use crate::{Primitive, Renderer};
use iced_native::{column, Column, Layout, Point};

impl column::Renderer for Renderer {
    fn draw<Message>(
        &mut self,
        column: &Column<'_, Message, Self>,
        layout: Layout<'_>,
        cursor_position: Point,
    ) -> Self::Primitive {
        Primitive::Group {
            primitives: column
                .children
                .iter()
                .zip(layout.children())
                .map(|(child, layout)| {
                    child.draw(self, layout, cursor_position)
                })
                .collect(),
        }
    }
}