use au in TextFragment (#32653)

This commit is contained in:
atbrakhi 2024-07-03 09:27:08 +02:00 committed by GitHub
parent fe58a5f0a3
commit 4357751f28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 5 deletions

View file

@ -961,7 +961,7 @@ fn rgba(color: AbsoluteColor) -> wr::ColorF {
fn glyphs(
glyph_runs: &[Arc<GlyphStore>],
mut baseline_origin: PhysicalPoint<Au>,
justification_adjustment: Length,
justification_adjustment: Au,
) -> Vec<wr::GlyphInstance> {
use fonts_traits::ByteIndex;
use range::Range;
@ -983,7 +983,7 @@ fn glyphs(
}
if glyph.char_is_word_separator() {
baseline_origin.x += justification_adjustment.into();
baseline_origin.x += justification_adjustment;
}
baseline_origin.x += glyph.advance();
}

View file

@ -245,7 +245,7 @@ impl TextRunLineItem {
font_key: self.font_key,
glyphs: self.text,
text_decoration_line: self.text_decoration_line,
justification_adjustment: state.justification_adjustment,
justification_adjustment: state.justification_adjustment.into(),
})
}
}

View file

@ -11,7 +11,6 @@ use fonts::{FontMetrics, GlyphStore};
use serde::Serialize;
use servo_arc::Arc as ServoArc;
use style::properties::ComputedValues;
use style::values::computed::Length;
use style::values::specified::text::TextDecorationLine;
use style::Zero;
use webrender_api::{FontInstanceKey, ImageKey};
@ -75,7 +74,7 @@ pub(crate) struct TextFragment {
pub text_decoration_line: TextDecorationLine,
/// Extra space to add for each justification opportunity.
pub justification_adjustment: Length,
pub justification_adjustment: Au,
}
#[derive(Serialize)]