diff --git a/crates/text/src/positioned.rs b/crates/text/src/positioned.rs index 2587c8b22..81afdbae9 100644 --- a/crates/text/src/positioned.rs +++ b/crates/text/src/positioned.rs @@ -74,11 +74,13 @@ pub struct PositionedGlyph { } impl PositionedGlyph { - fn width_stops(&self) -> impl Iterator + '_ { + /// Source caret stops as fractions of glyph width. + pub fn width_stops(&self) -> impl Iterator + '_ { std::iter::once((self.byte, 0.0)).chain(self.carets.iter().copied()).chain(std::iter::once((self.byte + self.len, 1.0))) } - fn stops_along(&self, extent: f64) -> impl Iterator + '_ { + /// Source caret stops measured from the logical leading edge. + pub fn stops_along(&self, extent: f64) -> impl Iterator + '_ { let (width, start) = if self.width > 0.0 && self.width.is_finite() { (self.width, if self.width_start.is_finite() { self.width_start } else { 0.0 }) } else {