瀏覽代碼

Fix Tree keyboard navigation in RTL direction

(cherry picked from commit bd6312383549211b5123cad2194ec8fbdd5d0458)
Giganzo 7 月之前
父節點
當前提交
642c82a1d8
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      scene/gui/tree.cpp

+ 2 - 2
scene/gui/tree.cpp

@@ -3506,7 +3506,7 @@ void Tree::gui_input(const Ref<InputEvent> &p_event) {
 	Ref<InputEventKey> k = p_event;
 
 	bool is_command = k.is_valid() && k->is_command_or_control_pressed();
-	if (p_event->is_action("ui_right") && p_event->is_pressed()) {
+	if (p_event->is_action(cache.rtl ? "ui_left" : "ui_right") && p_event->is_pressed()) {
 		if (!cursor_can_exit_tree) {
 			accept_event();
 		}
@@ -3524,7 +3524,7 @@ void Tree::gui_input(const Ref<InputEvent> &p_event) {
 		} else {
 			_go_down();
 		}
-	} else if (p_event->is_action("ui_left") && p_event->is_pressed()) {
+	} else if (p_event->is_action(cache.rtl ? "ui_right" : "ui_left") && p_event->is_pressed()) {
 		if (!cursor_can_exit_tree) {
 			accept_event();
 		}