Skip to content

Commit 41e5e9a

Browse files
Drag and drop layer/frame/cel buttons on touchscreens when they are pressed
Otherwise scroll the timeline
1 parent 93bd9bd commit 41e5e9a

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

src/UI/Timeline/CelButton.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ func _dim_checker() -> void:
273273

274274

275275
func _get_drag_data(_position: Vector2) -> Variant:
276-
if DisplayServer.is_touchscreen_available():
276+
if DisplayServer.is_touchscreen_available() and not button_pressed:
277277
return null
278278
var button := Button.new()
279279
button.size = size

src/UI/Timeline/FrameButton.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func _on_PopupMenu_id_pressed(id: int) -> void:
110110

111111

112112
func _get_drag_data(_position: Vector2) -> Variant:
113-
if DisplayServer.is_touchscreen_available():
113+
if DisplayServer.is_touchscreen_available() and not button_pressed:
114114
return null
115115
var button := Button.new()
116116
button.size = size

src/UI/Timeline/FrameScrollContainer.gd

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,23 @@ func _gui_input(event: InputEvent) -> void:
120120
):
121121
h_scroll_bar.value -= PAGE_DIVISOR * event.factor
122122
accept_event()
123-
elif (
123+
return
124+
if (
124125
event.button_index == MOUSE_BUTTON_WHEEL_DOWN
125126
or event.button_index == MOUSE_BUTTON_WHEEL_RIGHT
126127
):
127128
h_scroll_bar.value += PAGE_DIVISOR * event.factor
128129
accept_event()
130+
return
129131
_touchscreen_scroll(event)
130132

131133

132134
func _touchscreen_scroll(event: InputEvent) -> void:
133135
if not DisplayServer.is_touchscreen_available():
134136
return
137+
if get_viewport().gui_is_dragging() and not scroll_on_drag_hover:
138+
_cancel_drag()
139+
return
135140
var prev_h_scroll := h_scroll_bar.value
136141
# Handle mouse button input
137142
if event is InputEventMouseButton:

src/UI/Timeline/LayerMainButton.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ func _ready() -> void:
1212

1313

1414
func _get_drag_data(_position: Vector2) -> Variant:
15-
if DisplayServer.is_touchscreen_available():
15+
if DisplayServer.is_touchscreen_available() and not button_pressed:
1616
return null
1717
var layers := _get_layer_indices()
1818
for layer_i in layers: # Add child layers, if we have selected groups

0 commit comments

Comments
 (0)