Use integer text position in scroll container, TextEdit and canvas editor, to ensure sharp text rendering.

Use integer font align/advance with any font scaling, to ensure sharp text rendering.
This commit is contained in:
bruvzg
2020-12-17 13:22:04 +02:00
parent 7d5a8ea0e9
commit 1adea98d07
6 changed files with 9 additions and 8 deletions

View File

@@ -74,7 +74,7 @@ void ProgressBar::_notification(int p_what) {
if (percent_visible) {
String txt = TS->format_number(itos(int(get_as_ratio() * 100))) + TS->percent_sign();
TextLine tl = TextLine(txt, font, font_size);
tl.draw(get_canvas_item(), Point2(get_size().width - tl.get_size().x, get_size().height - tl.get_size().y) / 2, font_color);
tl.draw(get_canvas_item(), (Point2(get_size().width - tl.get_size().x, get_size().height - tl.get_size().y) / 2).round(), font_color);
}
}
}