Fix underline and strike-through positioning.

This commit is contained in:
Martín Lucas Golini
2025-12-22 21:03:43 -03:00
parent 8a3b9f2bfb
commit 9ee71f3ca1

View File

@@ -4161,19 +4161,19 @@ void UICodeEditor::drawLineText( const Int64& line, Vector2f position, const Flo
for ( auto& rect : rects ) {
if ( screenBounds.intersect( rect ) ) {
if ( fontStyle.Style & Text::Underlined ) {
Text::drawUnderline( rect.getPosition(), rect.getWidth(), fontStyle.Font,
fontStyle.CharacterSize, fontStyle.FontColor,
fontStyle.Style, fontStyle.OutlineThickness,
fontStyle.OutlineColor, fontStyle.ShadowColor,
fontStyle.ShadowOffset );
Text::drawUnderline(
{ rect.getPosition().x, rect.getPosition().y + lineOffset },
rect.getWidth(), fontStyle.Font, fontStyle.CharacterSize,
fontStyle.FontColor, fontStyle.Style, fontStyle.OutlineThickness,
fontStyle.OutlineColor, fontStyle.ShadowColor, fontStyle.ShadowOffset );
}
if ( fontStyle.Style & Text::StrikeThrough ) {
Text::drawStrikeThrough( rect.getPosition(), rect.getWidth(),
fontStyle.Font, fontStyle.CharacterSize,
fontStyle.FontColor, fontStyle.Style,
fontStyle.OutlineThickness, fontStyle.OutlineColor,
fontStyle.ShadowColor, fontStyle.ShadowOffset );
Text::drawStrikeThrough(
{ rect.getPosition().x, rect.getPosition().y + lineOffset },
rect.getWidth(), fontStyle.Font, fontStyle.CharacterSize,
fontStyle.FontColor, fontStyle.Style, fontStyle.OutlineThickness,
fontStyle.OutlineColor, fontStyle.ShadowColor, fontStyle.ShadowOffset );
}
}
}