Skip to content

Commit

Permalink
remove lock
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDanisch committed Oct 14, 2024
1 parent 6fe360f commit cd5298e
Showing 1 changed file with 20 additions and 22 deletions.
42 changes: 20 additions & 22 deletions src/interaction/inspector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -311,33 +311,31 @@ DataInspector(; kwargs...) = DataInspector(current_figure(); kwargs...)

function on_hover(inspector)
parent = inspector.root
lock(inspector.lock) do
(inspector.attributes.enabled[] && is_mouseinside(parent)) || return Consume(false)

mp = mouseposition_px(parent)
should_clear = true
for (plt, idx) in pick_sorted(parent, mp, inspector.attributes.range[])
if to_value(get(plt.attributes, :inspectable, true))
# show_data should return true if it created a tooltip
if show_data_recursion(inspector, plt, idx)
should_clear = false
break
end
(inspector.attributes.enabled[] && is_mouseinside(parent)) || return Consume(false)

mp = mouseposition_px(parent)
should_clear = true
for (plt, idx) in pick_sorted(parent, mp, inspector.attributes.range[])
if to_value(get(plt.attributes, :inspectable, true))
# show_data should return true if it created a tooltip
if show_data_recursion(inspector, plt, idx)
should_clear = false
break
end
end
end

if should_clear
plot = inspector.selection
if to_value(get(plot, :inspector_clear, automatic)) !== automatic
plot[:inspector_clear][](inspector, plot)
end
inspector.plot.visible[] = false
inspector.attributes.indicator_visible[] = false
inspector.plot.offset.val = inspector.attributes.offset[]
if should_clear
plot = inspector.selection
if to_value(get(plot, :inspector_clear, automatic)) !== automatic
plot[:inspector_clear][](inspector, plot)
end

return Consume(false)
inspector.plot.visible[] = false
inspector.attributes.indicator_visible[] = false
inspector.plot.offset.val = inspector.attributes.offset[]
end

return Consume(false)
end


Expand Down

0 comments on commit cd5298e

Please sign in to comment.