summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-02-01 20:42:52 +0100
committerGitHub <noreply@github.com>2021-02-01 20:42:52 +0100
commit0db77315febc302aacef8c913a62f6eb0febf38b (patch)
tree95ad9057b8024fbd31f1fbbe18d50c4be0592442 /scene
parent46a2cc614106f987fe12f2e8cb810d2422d1aede (diff)
parentc75923498e9a60466a0dde7a5fed3dd0108a790f (diff)
Merge pull request #45608 from bruvzg/font_int_coords
Use integer coordinates for the font glyphs rendering.
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/button.cpp4
-rw-r--r--scene/gui/item_list.cpp2
2 files changed, 2 insertions, 4 deletions
diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp
index f7c9583fbf..8b3daf79a8 100644
--- a/scene/gui/button.cpp
+++ b/scene/gui/button.cpp
@@ -306,10 +306,10 @@ void Button::_notification(int p_what) {
Color font_outline_color = get_theme_color("font_outline_color");
int outline_size = get_theme_constant("outline_size");
if (outline_size > 0 && font_outline_color.a > 0) {
- text_buf->draw_outline(ci, text_ofs.floor(), outline_size, font_outline_color);
+ text_buf->draw_outline(ci, text_ofs, outline_size, font_outline_color);
}
- text_buf->draw(ci, text_ofs.floor(), color);
+ text_buf->draw(ci, text_ofs, color);
if (!_icon.is_null() && icon_region.size.width > 0) {
draw_texture_rect_region(_icon, icon_region, Rect2(Point2(), _icon->get_size()), color_icon);
diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp
index 799b0ed612..bd57817bd3 100644
--- a/scene/gui/item_list.cpp
+++ b/scene/gui/item_list.cpp
@@ -1194,7 +1194,6 @@ void ItemList::_notification(int p_what) {
}
if (icon_mode == ICON_MODE_TOP && max_text_lines > 0) {
- text_ofs = text_ofs.floor();
text_ofs += base_ofs;
text_ofs += items[i].rect_cache.position;
@@ -1217,7 +1216,6 @@ void ItemList::_notification(int p_what) {
text_ofs.y += (items[i].rect_cache.size.height - size2.y) / 2;
}
- text_ofs = text_ofs.floor();
text_ofs += base_ofs;
text_ofs += items[i].rect_cache.position;