summaryrefslogtreecommitdiffstats
path: root/wgpu/src/text.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-10-24 02:51:02 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-02-02 01:55:32 +0100
commitaa41d7656e734b5dae3c19dff87afbc74617a67f (patch)
tree2b2a074998ed5d39e2901d25627a295d3dfb24d4 /wgpu/src/text.rs
parent9b8614a4e2252f0b74d1a1b38b5e5bb55b1af995 (diff)
downloadiced-aa41d7656e734b5dae3c19dff87afbc74617a67f.tar.gz
iced-aa41d7656e734b5dae3c19dff87afbc74617a67f.tar.bz2
iced-aa41d7656e734b5dae3c19dff87afbc74617a67f.zip
Apply `Transform` scaling to text primitives
Diffstat (limited to 'wgpu/src/text.rs')
-rw-r--r--wgpu/src/text.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs
index dca09cb8..4a151073 100644
--- a/wgpu/src/text.rs
+++ b/wgpu/src/text.rs
@@ -124,11 +124,13 @@ impl Pipeline {
vertical_alignment,
color,
clip_bounds,
+ scale,
) = match section {
Text::Paragraph {
position,
color,
clip_bounds,
+ scale,
..
} => {
use crate::core::text::Paragraph as _;
@@ -145,12 +147,14 @@ impl Pipeline {
paragraph.vertical_alignment(),
*color,
*clip_bounds,
+ *scale,
)
}
Text::Editor {
position,
color,
clip_bounds,
+ scale,
..
} => {
use crate::core::text::Editor as _;
@@ -167,6 +171,7 @@ impl Pipeline {
alignment::Vertical::Top,
*color,
*clip_bounds,
+ *scale,
)
}
Text::Cached(text) => {
@@ -186,6 +191,7 @@ impl Pipeline {
text.vertical_alignment,
text.color,
text.clip_bounds,
+ 1.0,
)
}
Text::Raw(text) => {
@@ -205,6 +211,7 @@ impl Pipeline {
alignment::Vertical::Top,
text.color,
text.clip_bounds,
+ 1.0,
)
}
};
@@ -234,7 +241,7 @@ impl Pipeline {
buffer,
left,
top,
- scale: scale_factor,
+ scale: scale * scale_factor,
bounds: glyphon::TextBounds {
left: clip_bounds.x as i32,
top: clip_bounds.y as i32,