summaryrefslogtreecommitdiffstats
path: root/wgpu/src/layer
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-02-02 14:43:04 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-02-02 14:43:04 +0100
commitb3adf3184594c9bf60e0548a0362d30c512f3966 (patch)
treee99e7a55873678ac37fd695a0f46c1350b30dd2f /wgpu/src/layer
parenta06682ff420678f7068265191738ab70ebe30b4c (diff)
downloadiced-b3adf3184594c9bf60e0548a0362d30c512f3966.tar.gz
iced-b3adf3184594c9bf60e0548a0362d30c512f3966.tar.bz2
iced-b3adf3184594c9bf60e0548a0362d30c512f3966.zip
Apply `Transformation` to `RawText` primitives
Diffstat (limited to '')
-rw-r--r--wgpu/src/layer.rs17
-rw-r--r--wgpu/src/layer/text.rs6
2 files changed, 10 insertions, 13 deletions
diff --git a/wgpu/src/layer.rs b/wgpu/src/layer.rs
index 12588849..cc767c25 100644
--- a/wgpu/src/layer.rs
+++ b/wgpu/src/layer.rs
@@ -181,20 +181,13 @@ impl<'a> Layer<'a> {
clip_bounds: *clip_bounds * transformation,
}));
}
- graphics::Primitive::RawText(graphics::text::Raw {
- buffer,
- position,
- color,
- clip_bounds,
- }) => {
+ graphics::Primitive::RawText(raw) => {
let layer = &mut layers[current_layer];
- layer.text.push(Text::Raw(graphics::text::Raw {
- buffer: buffer.clone(),
- position: *position * transformation,
- color: *color,
- clip_bounds: *clip_bounds * transformation,
- }));
+ layer.text.push(Text::Raw {
+ raw: raw.clone(),
+ transformation,
+ });
}
Primitive::Quad {
bounds,
diff --git a/wgpu/src/layer/text.rs b/wgpu/src/layer/text.rs
index 4c2b66a4..b3a00130 100644
--- a/wgpu/src/layer/text.rs
+++ b/wgpu/src/layer/text.rs
@@ -29,7 +29,11 @@ pub enum Text<'a> {
/// Some cached text.
Cached(Cached<'a>),
/// Some raw text.
- Raw(graphics::text::Raw),
+ #[allow(missing_docs)]
+ Raw {
+ raw: graphics::text::Raw,
+ transformation: Transformation,
+ },
}
#[derive(Debug, Clone)]