Browse Source

Apply viewport scale to selection update methods. Changed to propper fix sugested by reduz

Gabriel Gavilan 7 years ago
parent
commit
b0069bb118
1 changed files with 3 additions and 3 deletions
  1. 3 3
      scene/gui/text_edit.cpp

+ 3 - 3
scene/gui/text_edit.cpp

@@ -415,7 +415,7 @@ void TextEdit::_click_selection_held() {
 }
 }
 
 
 void TextEdit::_update_selection_mode_pointer() {
 void TextEdit::_update_selection_mode_pointer() {
-	Point2 mp = Input::get_singleton()->get_mouse_position() - get_global_position();
+	Point2 mp = get_local_mouse_position();
 
 
 	int row, col;
 	int row, col;
 	_get_mouse_pos(Point2i(mp.x, mp.y), row, col);
 	_get_mouse_pos(Point2i(mp.x, mp.y), row, col);
@@ -430,7 +430,7 @@ void TextEdit::_update_selection_mode_pointer() {
 }
 }
 
 
 void TextEdit::_update_selection_mode_word() {
 void TextEdit::_update_selection_mode_word() {
-	Point2 mp = Input::get_singleton()->get_mouse_position() - get_global_position();
+	Point2 mp = get_local_mouse_position();
 
 
 	int row, col;
 	int row, col;
 	_get_mouse_pos(Point2i(mp.x, mp.y), row, col);
 	_get_mouse_pos(Point2i(mp.x, mp.y), row, col);
@@ -483,7 +483,7 @@ void TextEdit::_update_selection_mode_word() {
 }
 }
 
 
 void TextEdit::_update_selection_mode_line() {
 void TextEdit::_update_selection_mode_line() {
-	Point2 mp = Input::get_singleton()->get_mouse_position() - get_global_position();
+	Point2 mp = get_local_mouse_position();
 
 
 	int row, col;
 	int row, col;
 	_get_mouse_pos(Point2i(mp.x, mp.y), row, col);
 	_get_mouse_pos(Point2i(mp.x, mp.y), row, col);