Color codes are factored in for purposes of wrapping

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Accensus
Posts: 2378
Joined: Thu Feb 11, 2016 9:59 am

Color codes are factored in for purposes of wrapping

Post by Accensus »

Unknown version. This was tested on 4.8.2, but I'm fairly certain it's nothing new.

It makes wrapping or automatically breaking colored strings completely useless. This is both the case for StatusBarCore::DrawString's wrapwidth argument and Font::BreakLines. If the break width is set to the 10th character in BreakLines, the string \c[Red]Bazinga\c- will get split at around "Baz" because, although invisible, the color codes count towards the characters.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48376
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Color codes are factored in for purposes of wrapping

Post by Graf Zahl »

Uh.
BreakLines does not measure characters, it measures screen units of the text's width. And surely it considers color control sequences, otherwise the console would look all screwed up!

Return to “Closed Bugs [GZDoom]”