Browse Source

Fix:code editor text size should change at least one each time, don't mind how you setting your display scale

RaphaelHunter 7 years ago
parent
commit
eeb0534426
1 changed files with 2 additions and 2 deletions
  1. 2 2
      editor/code_editor.cpp

+ 2 - 2
editor/code_editor.cpp

@@ -650,12 +650,12 @@ void CodeTextEditor::_text_editor_gui_input(const Ref<InputEvent> &p_event) {
 }
 }
 
 
 void CodeTextEditor::_zoom_in() {
 void CodeTextEditor::_zoom_in() {
-	font_resize_val += EDSCALE;
+	font_resize_val += MAX(EDSCALE, 1.0f);
 	_zoom_changed();
 	_zoom_changed();
 }
 }
 
 
 void CodeTextEditor::_zoom_out() {
 void CodeTextEditor::_zoom_out() {
-	font_resize_val -= EDSCALE;
+	font_resize_val -= MAX(EDSCALE, 1.0f);
 	_zoom_changed();
 	_zoom_changed();
 }
 }