Kaynağa Gözat

Merge pull request #107413 from roughbits01/fix-ime-window-position

Fix IME window position not taking into account window transform
Rémi Verschelde 1 ay önce
ebeveyn
işleme
c3ce623b54
2 değiştirilmiş dosya ile 4 ekleme ve 0 silme
  1. 2 0
      scene/gui/line_edit.cpp
  2. 2 0
      scene/gui/text_edit.cpp

+ 2 - 0
scene/gui/line_edit.cpp

@@ -132,6 +132,8 @@ void LineEdit::_update_ime_window_position() {
 	if (get_window()->get_embedder()) {
 	if (get_window()->get_embedder()) {
 		pos += get_viewport()->get_popup_base_transform().get_origin();
 		pos += get_viewport()->get_popup_base_transform().get_origin();
 	}
 	}
+	// Take into account the window's transform.
+	pos = get_window()->get_screen_transform().xform(pos);
 	// The window will move to the updated position the next time the IME is updated, not immediately.
 	// The window will move to the updated position the next time the IME is updated, not immediately.
 	DisplayServer::get_singleton()->window_set_ime_position(pos, wid);
 	DisplayServer::get_singleton()->window_set_ime_position(pos, wid);
 }
 }

+ 2 - 0
scene/gui/text_edit.cpp

@@ -3427,6 +3427,8 @@ void TextEdit::_update_ime_window_position() {
 	if (get_window()->get_embedder()) {
 	if (get_window()->get_embedder()) {
 		pos += get_viewport()->get_popup_base_transform().get_origin();
 		pos += get_viewport()->get_popup_base_transform().get_origin();
 	}
 	}
+	// Take into account the window's transform.
+	pos = get_window()->get_screen_transform().xform(pos);
 	// The window will move to the updated position the next time the IME is updated, not immediately.
 	// The window will move to the updated position the next time the IME is updated, not immediately.
 	DisplayServer::get_singleton()->window_set_ime_position(pos, wid);
 	DisplayServer::get_singleton()->window_set_ime_position(pos, wid);
 }
 }