Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set all event priorities to 50 to be beneath menu a 65 #13

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/geometry_canvas.jl
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ function draw_current_point!(fig, ax::Axis, c::GeometryCanvas;
end
end
p = scatter!(ax, current_point_pos; color=:red, scatter_kw...)
translate!(p, 0, 0, 100)
translate!(p, 0, 0, 50)
end

# Point selection and movement
Expand All @@ -427,7 +427,7 @@ function add_events!(c::GeometryCanvas{<:Point};


# Mouse down event
on(events(ax.scene).mousebutton, priority=-100) do event
on(events(ax.scene).mousebutton, priority=50) do event
# If this canvas is not active dont respond to mouse events
(; geoms, points, dragging, active, section) = c
active[] || return Consume(false)
Expand Down Expand Up @@ -472,7 +472,7 @@ function add_events!(c::GeometryCanvas{<:Point};
end

# Mouse drag event
on(events(fig).mouseposition, priority=100) do event
on(events(fig).mouseposition, priority=50) do event
c.active[] || return Consume(false)
idx = c.current_point
_isvalid_current_point(idx) || return Consume(true)
Expand All @@ -498,7 +498,7 @@ function add_events!(c::GeometryCanvas{<:Point};
return Consume(false)
end

on(events(ax.scene).keyboardbutton, priority=100) do event
on(events(ax.scene).keyboardbutton, priority=50) do event
(; geoms, points, active, section) = c
active[] || return Consume(false)
(event.action in (Keyboard.press, Keyboard.repeat) && event.key == Keyboard.delete) || return Consume(false)
Expand All @@ -523,7 +523,7 @@ function add_events!(c::GeometryCanvas{T};
accuracy = _accuracy(ax, c.accuracy_scale)

# Mouse down event
on(events(ax.scene).mousebutton, priority=100) do event
on(events(ax.scene).mousebutton, priority=50) do event
(; geoms, points, dragging, active, section) = c

active[] || return Consume(false)
Expand Down Expand Up @@ -618,7 +618,7 @@ function add_events!(c::GeometryCanvas{T};
end

# Mouse drag event
on(events(fig).mouseposition, priority=100) do mp
on(events(fig).mouseposition, priority=50) do mp
c.active[] || return Consume(false)
idx = c.current_point
_isvalid_current_point(idx) || return Consume(true)
Expand Down
4 changes: 2 additions & 2 deletions src/paint_canvas.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ end
function add_mouse_events!(fig::Figure, ax::Axis, c::PaintCanvas)
lastpos = Observable{Any}()
(; drawing, drawbutton, active) = c
on(events(ax.scene).mousebutton, priority = 100) do event
on(events(ax.scene).mousebutton; priority=50) do event

# If this canvas is not active dont respond to mouse events
active[] || return Consume(false)
Expand Down Expand Up @@ -121,7 +121,7 @@ function add_mouse_events!(fig::Figure, ax::Axis, c::PaintCanvas)
end

# Mouse drag event
on(events(fig).mouseposition, priority = 100) do event
on(events(fig).mouseposition; priority=50) do event
active[] || return Consume(false)
if drawing[]
fig_pos = Makie.mouseposition_px(fig.scene)
Expand Down
Loading