aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authoratbrakhi <atbrakhi@igalia.com>2024-07-03 09:27:08 +0200
committerGitHub <noreply@github.com>2024-07-03 07:27:08 +0000
commit4357751f285c79bf37a8e7a02d4c8dc4f7a8ae69 (patch)
treea7005ddfdd59c2cf1690ac89fe224edb5b359386 /components
parentfe58a5f0a3bd9a20e368ed283dfcb89769f75c00 (diff)
downloadservo-4357751f285c79bf37a8e7a02d4c8dc4f7a8ae69.tar.gz
servo-4357751f285c79bf37a8e7a02d4c8dc4f7a8ae69.zip
use au in TextFragment (#32653)
Diffstat (limited to 'components')
-rw-r--r--components/layout_2020/display_list/mod.rs4
-rw-r--r--components/layout_2020/flow/inline/line.rs2
-rw-r--r--components/layout_2020/fragment_tree/fragment.rs3
3 files changed, 4 insertions, 5 deletions
diff --git a/components/layout_2020/display_list/mod.rs b/components/layout_2020/display_list/mod.rs
index f4fba3ca927..0049ebebf35 100644
--- a/components/layout_2020/display_list/mod.rs
+++ b/components/layout_2020/display_list/mod.rs
@@ -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();
}
diff --git a/components/layout_2020/flow/inline/line.rs b/components/layout_2020/flow/inline/line.rs
index bfd8209809e..08d645fcb23 100644
--- a/components/layout_2020/flow/inline/line.rs
+++ b/components/layout_2020/flow/inline/line.rs
@@ -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(),
})
}
}
diff --git a/components/layout_2020/fragment_tree/fragment.rs b/components/layout_2020/fragment_tree/fragment.rs
index 7fcf2cfbb18..8456ef3eec6 100644
--- a/components/layout_2020/fragment_tree/fragment.rs
+++ b/components/layout_2020/fragment_tree/fragment.rs
@@ -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)]