瀏覽代碼

Allow horizontal scrolling in Tree using Shift

kobewi 1 年之前
父節點
當前提交
42e5c5b41c
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      scene/gui/tree.cpp

+ 4 - 4
scene/gui/tree.cpp

@@ -3957,25 +3957,25 @@ void Tree::gui_input(const Ref<InputEvent> &p_event) {
 
 			} break;
 			case MouseButton::WHEEL_UP: {
-				if (_scroll(false, -mb->get_factor() / 8)) {
+				if (_scroll(mb->is_shift_pressed(), -mb->get_factor() / 8)) {
 					accept_event();
 				}
 
 			} break;
 			case MouseButton::WHEEL_DOWN: {
-				if (_scroll(false, mb->get_factor() / 8)) {
+				if (_scroll(mb->is_shift_pressed(), mb->get_factor() / 8)) {
 					accept_event();
 				}
 
 			} break;
 			case MouseButton::WHEEL_LEFT: {
-				if (_scroll(true, -mb->get_factor() / 8)) {
+				if (_scroll(!mb->is_shift_pressed(), -mb->get_factor() / 8)) {
 					accept_event();
 				}
 
 			} break;
 			case MouseButton::WHEEL_RIGHT: {
-				if (_scroll(true, mb->get_factor() / 8)) {
+				if (_scroll(!mb->is_shift_pressed(), mb->get_factor() / 8)) {
 					accept_event();
 				}