Skip to content

Commit a2ce76c

Browse files
committed
Update load from website dialog warping
1 parent 6337513 commit a2ce76c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

material_maker/windows/load_from_website/load_from_website.gd

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ var displayed_assets : Array = []
66
var thumbnail_update_thread : Thread = null
77
var only_return_index : bool = false
88

9+
var _is_item_list_warping_mouse : int = 0
10+
911
@onready var item_list : ItemList = $VBoxContainer/ItemList
1012

1113

@@ -138,12 +140,17 @@ func _on_Filter_changed(new_text):
138140
func _on_item_list_gui_input(event: InputEvent) -> void:
139141
if event is InputEventMouseMotion and (
140142
event.button_mask & MOUSE_BUTTON_MASK_MIDDLE) != 0:
141-
$VBoxContainer/ItemList.get_v_scroll_bar().value -= event.relative.y
143+
144+
_is_item_list_warping_mouse -= 1 if _is_item_list_warping_mouse else 0
145+
if not _is_item_list_warping_mouse:
146+
$VBoxContainer/ItemList.get_v_scroll_bar().value -= event.relative.y
142147

143148
var rect : Rect2 = $VBoxContainer/ItemList.get_rect()
144149
var mouse_pos = $VBoxContainer/ItemList.get_local_mouse_position()
145150

146151
if mouse_pos.y > rect.size.y:
152+
_is_item_list_warping_mouse = 2
147153
mm_globals.do_warp_mouse(Vector2(mouse_pos.x, 0), $VBoxContainer/ItemList)
148154
elif mouse_pos.y < 0:
155+
_is_item_list_warping_mouse = 2
149156
mm_globals.do_warp_mouse(Vector2(mouse_pos.x, rect.size.y), $VBoxContainer/ItemList)

0 commit comments

Comments
 (0)