Skip to content

Commit 0cda576

Browse files
committed
refactor(engine): trim FontLineMetrics to a bare metrics carrier
Drop the unused lineHeight()/baselineOffsetFromBottom() convenience methods: the measurement system reads ascent()/descent()/leading() directly and converts to TextMeasurementSystem.LineMetrics (which owns the derived helpers), so they had no callers. Review-driven dead-code removal; no behaviour change.
1 parent 20b4f7c commit 0cda576

1 file changed

Lines changed: 5 additions & 18 deletions

File tree

src/main/java/com/demcha/compose/engine/font/FontLineMetrics.java

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,14 @@
1212
* already depends on {@code engine.font}); the measurement system converts this
1313
* record into its own {@code LineMetrics} for layout consumers.</p>
1414
*
15+
* <p>Carries only the three primitive components; the measurement system reads
16+
* them via {@code ascent()}/{@code descent()}/{@code leading()} and converts to
17+
* {@code TextMeasurementSystem.LineMetrics} (which owns the derived
18+
* {@code lineHeight()} / baseline helpers) for layout consumers.</p>
19+
*
1520
* @param ascent distance from the baseline to the glyph top
1621
* @param descent distance from the baseline to the glyph bottom (non-negative)
1722
* @param leading extra line leading applied by the backend font metrics
1823
*/
1924
public record FontLineMetrics(double ascent, double descent, double leading) {
20-
21-
/**
22-
* Returns the total baseline-to-baseline line height.
23-
*
24-
* @return {@code ascent + descent + leading}
25-
*/
26-
public double lineHeight() {
27-
return ascent + descent + leading;
28-
}
29-
30-
/**
31-
* Returns the distance from the line bottom to the text baseline.
32-
*
33-
* @return the baseline offset, equal to {@code descent}
34-
*/
35-
public double baselineOffsetFromBottom() {
36-
return descent;
37-
}
3825
}

0 commit comments

Comments
 (0)