Package net.minecraft.client.font
Class TextHandler.LineBreakingVisitor
java.lang.Object
net.minecraft.client.font.TextHandler.LineBreakingVisitor
- All Implemented Interfaces:
CharacterVisitor
- Enclosing class:
- TextHandler
@Environment(CLIENT) class TextHandler.LineBreakingVisitor extends Object implements CharacterVisitor
-
Field Summary
Fields Modifier and Type Field Description private intcountprivate intendIndexprivate StyleendStyleprivate intlastSpaceBreakprivate StylelastSpaceStyleprivate floatmaxWidthprivate booleannonEmptyprivate intstartOffsetprivate floattotalWidth -
Constructor Summary
Constructors Constructor Description LineBreakingVisitor(float maxWidth) -
Method Summary
Modifier and Type Method Description booleanaccept(int index, Style style, int codePoint)Visits a single character.private booleanbreakLine(int finishIndex, Style finishStyle)intgetEndingIndex()StylegetEndingStyle()private booleanhasLineBreak()voidoffset(int extraOffset)
-
Field Details
-
maxWidth
private final float maxWidth -
endIndex
private int endIndex -
endStyle
-
nonEmpty
private boolean nonEmpty -
totalWidth
private float totalWidth -
lastSpaceBreak
private int lastSpaceBreak -
lastSpaceStyle
-
count
private int count -
startOffset
private int startOffset
-
-
Constructor Details
-
LineBreakingVisitor
public LineBreakingVisitor(float maxWidth)
-
-
Method Details
-
accept
Visits a single character.Multiple surrogate characters are converted into one single
codePointwhen passed into this method.- Specified by:
acceptin interfaceCharacterVisitor- Parameters:
index- the current index of the characterstyle- the style of the character, containing formatting and font informationcodePoint- the code point of the character- Returns:
trueto continue visiting other characters, orfalseto terminate the visit
-
breakLine
-
hasLineBreak
private boolean hasLineBreak() -
getEndingIndex
public int getEndingIndex() -
getEndingStyle
-
offset
public void offset(int extraOffset)
-