diff options
author | 2023-12-05 02:19:17 +0100 | |
---|---|---|
committer | 2023-12-05 02:19:17 +0100 | |
commit | 603832e66c710ea39a95009ddc905de20c6856bd (patch) | |
tree | 9682de5108d8102b25c109c0388556c7c49794ec /wgpu/src/layer.rs | |
parent | fc285d3e461626408c56bbc1605fcf0c974b2f69 (diff) | |
download | iced-603832e66c710ea39a95009ddc905de20c6856bd.tar.gz iced-603832e66c710ea39a95009ddc905de20c6856bd.tar.bz2 iced-603832e66c710ea39a95009ddc905de20c6856bd.zip |
Introduce `RawText` to `Primitive` in `iced_graphics`
This should allow users to directly render a
`cosmic_text::Buffer`.
Diffstat (limited to 'wgpu/src/layer.rs')
-rw-r--r-- | wgpu/src/layer.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/wgpu/src/layer.rs b/wgpu/src/layer.rs index 557a7633..4ad12a88 100644 --- a/wgpu/src/layer.rs +++ b/wgpu/src/layer.rs @@ -177,6 +177,21 @@ impl<'a> Layer<'a> { clip_bounds: *clip_bounds + translation, })); } + graphics::Primitive::RawText(graphics::text::Raw { + buffer, + position, + color, + clip_bounds, + }) => { + let layer = &mut layers[current_layer]; + + layer.text.push(Text::Raw(graphics::text::Raw { + buffer: buffer.clone(), + position: *position + translation, + color: *color, + clip_bounds: *clip_bounds + translation, + })); + } Primitive::Quad { bounds, background, |