summaryrefslogtreecommitdiff
path: root/editor/plugins/texture_editor_plugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins/texture_editor_plugin.cpp')
-rw-r--r--editor/plugins/texture_editor_plugin.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp
index f8facb0fd5..9b760c0e50 100644
--- a/editor/plugins/texture_editor_plugin.cpp
+++ b/editor/plugins/texture_editor_plugin.cpp
@@ -79,6 +79,7 @@ void TextureEditor::_notification(int p_what) {
draw_texture_rect(texture, Rect2(ofs_x, ofs_y, tex_width, tex_height));
Ref<Font> font = get_theme_font("font", "Label");
+ int font_size = get_theme_font_size("font_size", "Label");
String format;
if (Object::cast_to<ImageTexture>(*texture)) {
@@ -90,16 +91,16 @@ void TextureEditor::_notification(int p_what) {
}
String text = itos(texture->get_width()) + "x" + itos(texture->get_height()) + " " + format;
- Size2 rect = font->get_string_size(text);
+ Size2 rect = font->get_string_size(text, font_size);
- Vector2 draw_from = size - rect + Size2(-2, font->get_ascent() - 2);
+ Vector2 draw_from = size - rect + Size2(-2, font->get_ascent(font_size) - 2);
if (draw_from.x < 0) {
draw_from.x = 0;
}
- draw_string(font, draw_from + Vector2(2, 2), text, Color(0, 0, 0, 0.5), size.width);
- draw_string(font, draw_from - Vector2(2, 2), text, Color(0, 0, 0, 0.5), size.width);
- draw_string(font, draw_from, text, Color(1, 1, 1, 1), size.width);
+ draw_string(font, draw_from + Vector2(2, 2), text, HALIGN_LEFT, size.width, font_size, Color(0, 0, 0, 0.5));
+ draw_string(font, draw_from - Vector2(2, 2), text, HALIGN_LEFT, size.width, font_size, Color(0, 0, 0, 0.5));
+ draw_string(font, draw_from, text, HALIGN_LEFT, size.width, font_size, Color(1, 1, 1, 1));
}
}