summaryrefslogtreecommitdiffstats
path: root/editor/code_editor.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-08-13 12:22:58 +0200
committerGitHub <noreply@github.com>2018-08-13 12:22:58 +0200
commit8cbd0902494707adeb41566b03ab7bc31921ae12 (patch)
tree808c9a615c895460ffafe8a90283a3dcb6b0e874 /editor/code_editor.cpp
parent652eb9347cb90ec02a842dcd53ccd17a5e1e207d (diff)
parentcbe95970217d7a9727dc1b4c9dfb6d3dab37a2bc (diff)
downloadredot-engine-8cbd0902494707adeb41566b03ab7bc31921ae12.tar.gz
Merge pull request #20670 from Calinou/script-editor-zoom-hidpi
Fix zoom display in the script editor on hiDPI displays
Diffstat (limited to 'editor/code_editor.cpp')
-rw-r--r--editor/code_editor.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index 29275947a4..9d4333bc29 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -745,7 +745,7 @@ bool CodeTextEditor::_add_font_size(int p_delta) {
if (font.is_valid()) {
int new_size = CLAMP(font->get_size() + p_delta, 8 * EDSCALE, 96 * EDSCALE);
- zoom_nb->set_text(itos(100 * new_size / 14) + "%");
+ zoom_nb->set_text(itos(100 * new_size / (14 * EDSCALE)) + "%");
if (new_size != font->get_size()) {
EditorSettings::get_singleton()->set("interface/editor/code_font_size", new_size / EDSCALE);
@@ -1341,7 +1341,7 @@ CodeTextEditor::CodeTextEditor() {
font_resize_val = 0;
font_size = EditorSettings::get_singleton()->get("interface/editor/code_font_size");
- zoom_nb->set_text(itos(100 * font_size / 14) + "%");
+ zoom_nb->set_text(itos(100 * font_size / (14 * EDSCALE)) + "%");
font_resize_timer = memnew(Timer);
add_child(font_resize_timer);
font_resize_timer->set_one_shot(true);