fix drag polling during overlay updates
This commit is contained in:
@@ -196,6 +196,31 @@ def handle_mouse_wheel(
|
||||
)
|
||||
|
||||
|
||||
def update_drag_from_button_state(
|
||||
state: MapState,
|
||||
*,
|
||||
mouse_pos: tuple[float, float],
|
||||
hit_rect: HitRect,
|
||||
is_down: bool,
|
||||
) -> None:
|
||||
"""Poll left-button state and keep drag interaction moving."""
|
||||
|
||||
with state.lock:
|
||||
active_drag = state.interaction.active_drag
|
||||
|
||||
if not is_down:
|
||||
if active_drag:
|
||||
handle_mouse_release(state)
|
||||
return
|
||||
|
||||
if active_drag:
|
||||
handle_mouse_drag(state, mouse_pos)
|
||||
return
|
||||
|
||||
if hit_rect.contains(mouse_pos[0], mouse_pos[1]):
|
||||
handle_mouse_down(state, mouse_pos, hit_rect)
|
||||
|
||||
|
||||
def wheel_delta_from_app_data(app_data: Any) -> float:
|
||||
"""Normalize Dear PyGui mouse wheel callback data."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user