Skip to content

Commit

Permalink
Parse and stack colors before visible text in TextFields
Browse files Browse the repository at this point in the history
  • Loading branch information
zxtej committed Jan 24, 2025
1 parent a907670 commit bd423a1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions arc-core/src/arc/graphics/g2d/GlyphLayout.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ else if(targetWidth <= fontData.spaceXadvance * 3) //
colorStack.add(color);
Pool<Color> colorPool = Pools.get(Color.class, Color::new);

if(markupEnabled && fontData.retainMarkup){
for(int i = 0; i < start; i++){
if(str.charAt(i) != '[') continue;
// Possible color tag.
int length = parseColorMarkup(str, i + 1, end, colorPool);
i += length >= 0 ? length + 1 : length == -2 ? 1 : 0;
}
color = colorStack.peek();
}
int runStart = start;
int skip = 0;
outer:
Expand Down

0 comments on commit bd423a1

Please sign in to comment.