summaryrefslogtreecommitdiffstats
path: root/wgpu/src/text.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-04-19 02:00:45 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-05-02 01:02:32 +0200
commit4bd290afe7d81d9aaf7467b3ce91491f6600261a (patch)
tree906bfe10f6118c86429c3bb83a8ce742dccb170a /wgpu/src/text.rs
parent33b5a900197e2798a393d6d9a0834039666eddbb (diff)
downloadiced-4bd290afe7d81d9aaf7467b3ce91491f6600261a.tar.gz
iced-4bd290afe7d81d9aaf7467b3ce91491f6600261a.tar.bz2
iced-4bd290afe7d81d9aaf7467b3ce91491f6600261a.zip
Introduce `text::Shaping` enum and replace magic boolean
Diffstat (limited to 'wgpu/src/text.rs')
-rw-r--r--wgpu/src/text.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs
index f433a5b6..fc126125 100644
--- a/wgpu/src/text.rs
+++ b/wgpu/src/text.rs
@@ -1,6 +1,6 @@
use crate::core::alignment;
use crate::core::font::{self, Font};
-use crate::core::text::Hit;
+use crate::core::text::{Hit, Shaping};
use crate::core::{Point, Rectangle, Size};
use crate::layer::Text;
@@ -83,7 +83,7 @@ impl Pipeline {
height: (section.bounds.height * scale_factor)
.ceil(),
},
- advanced_shape: section.advanced_shape,
+ shaping: section.shaping,
},
);
@@ -214,7 +214,7 @@ impl Pipeline {
size: f32,
font: Font,
bounds: Size,
- advanced_shape: bool,
+ shaping: Shaping,
) -> (f32, f32) {
let mut measurement_cache = self.measurement_cache.borrow_mut();
@@ -225,7 +225,7 @@ impl Pipeline {
size,
font,
bounds,
- advanced_shape,
+ shaping,
},
);
@@ -245,9 +245,9 @@ impl Pipeline {
size: f32,
font: Font,
bounds: Size,
+ shaping: Shaping,
point: Point,
_nearest_only: bool,
- advanced_shape: bool,
) -> Option<Hit> {
let mut measurement_cache = self.measurement_cache.borrow_mut();
@@ -258,7 +258,7 @@ impl Pipeline {
size,
font,
bounds,
- advanced_shape,
+ shaping,
},
);
@@ -369,7 +369,7 @@ impl Cache {
.family(to_family(key.font.family))
.weight(to_weight(key.font.weight))
.stretch(to_stretch(key.font.stretch)),
- !key.advanced_shape,
+ matches!(key.shaping, Shaping::Basic),
);
let _ = entry.insert(buffer);
@@ -394,7 +394,7 @@ struct Key<'a> {
size: f32,
font: Font,
bounds: Size,
- advanced_shape: bool,
+ shaping: Shaping,
}
type KeyHash = u64;