text: clippy 1.100 clean: the kerning row takes its side label built, as the leading row does; the axis value type named

This commit is contained in:
bflatastic
2026-11-22 22:36:47 +07:00
parent 7577f7a56c
commit 03ef469d99
2 changed files with 9 additions and 8 deletions
+7 -5
View File
@@ -640,16 +640,19 @@ pub struct CharacterValues {
pub font_height: Option<FontHeightReference>,
}
/// 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], f32)>>, Vec<[u8; 4]>) {
let shared: Vec<([u8; 4], f32)> = self
fn mix_axes(&self, other: &Self) -> (Option<Vec<AxisValue>>, Vec<[u8; 4]>) {
let shared: Vec<AxisValue> = 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),
+2 -3
View File
@@ -80,14 +80,13 @@ impl Lengths<'_> {
&self,
ui: &mut Ui,
label: Label,
glyph: GlyphLabel,
hint: Label,
side: SideLabel,
value: Option<NamedOr<KerningName>>,
presets: &[Entry<NumberPick>],
key: Option<DocKey>,
) -> EditEvents<NamedOr<KerningName>> {
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 {