Remove gaps between lines of selected text

This commit is contained in:
Tamás Bálint Misius
2020-07-01 16:18:35 +02:00
parent 1635c93822
commit 5c190c1a7a

View File

@@ -247,37 +247,37 @@ void Label::Draw(const Point& screenPos)
if (selectionLineH == selectionLineL) if (selectionLineH == selectionLineL)
{ {
g->fillrect( g->fillrect(
screenPos.X + textPosition.X + selectionXL, screenPos.X + textPosition.X + selectionXL - 1,
screenPos.Y + textPosition.Y + selectionYL - 1, screenPos.Y + textPosition.Y + selectionYL - 2,
selectionXH - selectionXL, selectionXH - selectionXL + 1,
FONT_H - 2, FONT_H,
255, 255, 255, 255 255, 255, 255, 255
); );
} }
else else
{ {
g->fillrect( g->fillrect(
screenPos.X + textPosition.X + selectionXL, screenPos.X + textPosition.X + selectionXL - 1,
screenPos.Y + textPosition.Y + selectionYL - 1, screenPos.Y + textPosition.Y + selectionYL - 2,
textSize.X - selectionXL, textSize.X - selectionXL + 1,
FONT_H - 2, FONT_H,
255, 255, 255, 255 255, 255, 255, 255
); );
for (int i = 1; i < selectionLineH - selectionLineL; ++i) for (int i = 1; i < selectionLineH - selectionLineL; ++i)
{ {
g->fillrect( g->fillrect(
screenPos.X + textPosition.X, screenPos.X + textPosition.X - 1,
screenPos.Y + textPosition.Y + selectionYL - 1 + i * FONT_H, screenPos.Y + textPosition.Y + selectionYL - 2 + i * FONT_H,
textSize.X, textSize.X + 1,
FONT_H - 2, FONT_H,
255, 255, 255, 255 255, 255, 255, 255
); );
} }
g->fillrect( g->fillrect(
screenPos.X + textPosition.X, screenPos.X + textPosition.X - 1,
screenPos.Y + textPosition.Y + selectionYH - 1, screenPos.Y + textPosition.Y + selectionYH - 2,
selectionXH, selectionXH + 1,
FONT_H - 2, FONT_H,
255, 255, 255, 255 255, 255, 255, 255
); );
} }