diff --git a/crates/text/src/ui/character.rs b/crates/text/src/ui/character.rs index 659f441d2..d71be741b 100644 --- a/crates/text/src/ui/character.rs +++ b/crates/text/src/ui/character.rs @@ -640,16 +640,19 @@ pub struct CharacterValues { pub font_height: Option, } +/// A variation axis's tag and its value. +type AxisValue = ([u8; 4], f32); + impl CharacterValues { /// The axis values of the face, none while the selection has no variable axes. - fn held_axes(&self) -> &[([u8; 4], f32)] { + fn held_axes(&self) -> &[AxisValue] { self.axes.as_deref().unwrap_or_default() } /// The axes two selections share with equal values, and the tags of the others: an axis mixes where either /// selection mixes it or the values differ. - fn mix_axes(&self, other: &Self) -> (Option>, Vec<[u8; 4]>) { - let shared: Vec<([u8; 4], f32)> = self + fn mix_axes(&self, other: &Self) -> (Option>, Vec<[u8; 4]>) { + let shared: Vec = self .held_axes() .iter() .filter(|(tag, value)| !self.mixed_axes.contains(tag) && !other.mixed_axes.contains(tag) && other.held_axes().contains(&(*tag, *value))) @@ -1028,8 +1031,7 @@ impl<'a> CharacterControls<'a> { let event = lengths.kerning( ui, words.kerning.clone(), - GlyphLabel::icon(IconId::new("text_cursor")), - words.kerning_hint.clone(), + mark(GlyphLabel::icon(IconId::new("text_cursor")), Some(words.kerning_hint.clone()), FieldLayout::Beside), kerning_shown, &kerning_presets, Some(keys::KERNING), diff --git a/crates/text/src/ui/character/rows.rs b/crates/text/src/ui/character/rows.rs index ad4923142..ce8b14aa9 100644 --- a/crates/text/src/ui/character/rows.rs +++ b/crates/text/src/ui/character/rows.rs @@ -80,14 +80,13 @@ impl Lengths<'_> { &self, ui: &mut Ui, label: Label, - glyph: GlyphLabel, - hint: Label, + side: SideLabel, value: Option>, presets: &[Entry], key: Option, ) -> EditEvents> { let units = self.units; - let shown = Field::new(label.clone()).side(mark(glyph, Some(hint), FieldLayout::Beside)).show(ui, |ui, _| { + let shown = Field::new(label.clone()).side(side).show(ui, |ui, _| { let field = NumberField::named(label.clone(), Bind::given(mixed(value))).range(TRACKING_RANGE).presets(presets).scrub_by_label(); let field = field.codec(NumberCodec::new(units.reader(None), 0)); match key {