From b3adf3184594c9bf60e0548a0362d30c512f3966 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 2 Feb 2024 14:43:04 +0100 Subject: Apply `Transformation` to `RawText` primitives --- wgpu/src/text.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'wgpu/src/text.rs') diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs index 15179ff3..6fa1922d 100644 --- a/wgpu/src/text.rs +++ b/wgpu/src/text.rs @@ -109,7 +109,9 @@ impl Pipeline { Some(Allocation::Cache(key)) } - Text::Raw(text) => text.buffer.upgrade().map(Allocation::Raw), + Text::Raw { raw, .. } => { + raw.buffer.upgrade().map(Allocation::Raw) + } }) .collect(); @@ -194,7 +196,10 @@ impl Pipeline { Transformation::IDENTITY, ) } - Text::Raw(text) => { + Text::Raw { + raw, + transformation, + } => { let Some(Allocation::Raw(buffer)) = allocation else { return None; }; @@ -204,14 +209,14 @@ impl Pipeline { ( buffer.as_ref(), Rectangle::new( - text.position, + raw.position, Size::new(width, height), ), alignment::Horizontal::Left, alignment::Vertical::Top, - text.color, - text.clip_bounds, - Transformation::IDENTITY, + raw.color, + raw.clip_bounds, + *transformation, ) } }; -- cgit