Class LineMetrics
- java.lang.Object
-
- io.github.humbleui.skija.paragraph.LineMetrics
-
public class LineMetrics extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description double_ascentThe final computed ascent for the line.double_baselineThe y position of the baseline for this line from the top of the paragraph.double_descentThe final computed descent for the line.long_endExcludingWhitespaceslong_endIncludingNewlinelong_endIndexThe index in the text buffer the line ends.boolean_hardBreakdouble_heightTotal height of the paragraph including the current line.double_leftThe left edge of the line.long_lineNumberZero indexed line numberlong_startIndexThe index in the text buffer the line begins.double_unscaledAscentdouble_widthWidth of the line.
-
Constructor Summary
Constructors Constructor Description LineMetrics(long startIndex, long endIndex, long endExcludingWhitespaces, long endIncludingNewline, boolean hardBreak, double ascent, double descent, double unscaledAscent, double height, double width, double left, double baseline, long lineNumber)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(java.lang.Object other)booleanequals(java.lang.Object o)doublegetAscent()The final computed ascent for the line.doublegetBaseline()The y position of the baseline for this line from the top of the paragraph.doublegetDescent()The final computed descent for the line.longgetEndExcludingWhitespaces()longgetEndIncludingNewline()longgetEndIndex()The index in the text buffer the line ends.doublegetHeight()Total height of the paragraph including the current line.doublegetLeft()The left edge of the line.doublegetLineHeight()The height of the current line, equals toMath.round(getAscent() + getDescent()).longgetLineNumber()Zero indexed line numberdoublegetRight()The right edge of the line, equals togetLeft() + getWidth()longgetStartIndex()The index in the text buffer the line begins.doublegetUnscaledAscent()doublegetWidth()Width of the line.inthashCode()booleanisHardBreak()java.lang.StringtoString()
-
-
-
Field Detail
-
_startIndex
public final long _startIndex
The index in the text buffer the line begins.
-
_endIndex
public final long _endIndex
The index in the text buffer the line ends.
-
_endExcludingWhitespaces
public final long _endExcludingWhitespaces
-
_endIncludingNewline
public final long _endIncludingNewline
-
_hardBreak
public final boolean _hardBreak
-
_ascent
public final double _ascent
The final computed ascent for the line. This can be impacted by the strut, height, scaling, as well as outlying runs that are very tall. The top edge isgetBaseline() - getAscent()and the bottom edge isgetBaseline() + getDescent(). Ascent and descent are provided as positive numbers. These values are the cumulative metrics for the entire line.
-
_descent
public final double _descent
The final computed descent for the line. This can be impacted by the strut, height, scaling, as well as outlying runs that are very tall. The top edge isgetBaseline() - getAscent()and the bottom edge isgetBaseline() + getDescent(). Ascent and descent are provided as positive numbers. These values are the cumulative metrics for the entire line.
-
_unscaledAscent
public final double _unscaledAscent
-
_height
public final double _height
Total height of the paragraph including the current line.
-
_width
public final double _width
Width of the line.
-
_left
public final double _left
The left edge of the line.
-
_baseline
public final double _baseline
The y position of the baseline for this line from the top of the paragraph.
-
_lineNumber
public final long _lineNumber
Zero indexed line number
-
-
Method Detail
-
getLineHeight
public double getLineHeight()
The height of the current line, equals toMath.round(getAscent() + getDescent()).
-
getRight
public double getRight()
The right edge of the line, equals togetLeft() + getWidth()
-
getStartIndex
public long getStartIndex()
The index in the text buffer the line begins.
-
getEndIndex
public long getEndIndex()
The index in the text buffer the line ends.
-
getEndExcludingWhitespaces
public long getEndExcludingWhitespaces()
-
getEndIncludingNewline
public long getEndIncludingNewline()
-
isHardBreak
public boolean isHardBreak()
-
getAscent
public double getAscent()
The final computed ascent for the line. This can be impacted by the strut, height, scaling, as well as outlying runs that are very tall. The top edge isgetBaseline() - getAscent()and the bottom edge isgetBaseline() + getDescent(). Ascent and descent are provided as positive numbers. These values are the cumulative metrics for the entire line.
-
getDescent
public double getDescent()
The final computed descent for the line. This can be impacted by the strut, height, scaling, as well as outlying runs that are very tall. The top edge isgetBaseline() - getAscent()and the bottom edge isgetBaseline() + getDescent(). Ascent and descent are provided as positive numbers. These values are the cumulative metrics for the entire line.
-
getUnscaledAscent
public double getUnscaledAscent()
-
getHeight
public double getHeight()
Total height of the paragraph including the current line.
-
getWidth
public double getWidth()
Width of the line.
-
getLeft
public double getLeft()
The left edge of the line.
-
getBaseline
public double getBaseline()
The y position of the baseline for this line from the top of the paragraph.
-
getLineNumber
public long getLineNumber()
Zero indexed line number
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-