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

Fix deactivated scroll interactions still consuming event #3272

Merged
merged 5 commits into from
Oct 5, 2023

Conversation

ffreyer
Copy link
Collaborator

@ffreyer ffreyer commented Oct 2, 2023

Description

Fixes a problem reported on discord. In the following example, scrolling in the overlap of the two axes results in no zooming:

using GLMakie
fig = Figure()
ax1 = Axis(fig[1:2, 1:2]; limits = (0, 10, 0, 10))
ax2 = Axis(fig[2:3, 2:3]; limits = (10, 20, 10, 20))
_interactions = (:rectanglezoom, :dragpan, :limitreset, :scrollzoom)
map(_interaction -> deactivate_interaction!(ax1, _interaction), _interactions)
translate!(ax2.blockscene, (0, 0, 1000))

This is because the scroll listener ignores whether the events it passed were processed or not. The pr fixes this.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • Added an entry in NEWS.md (for new features and breaking changes)
  • Added or changed relevant sections in the documentation
  • Added unit tests for new algorithms, conversion methods, etc.
  • Added reference image tests for new plotting functions, recipes, visual options, etc.

@MakieBot
Copy link
Collaborator

MakieBot commented Oct 2, 2023

Compile Times benchmark

Note, that these numbers may fluctuate on the CI servers, so take them with a grain of salt. All benchmark results are based on the mean time and negative percent mean faster than the base branch. Note, that GLMakie + WGLMakie run on an emulated GPU, so the runtime benchmark is much slower. Results are from running:

using_time = @ctime using Backend
# Compile time
create_time = @ctime fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @ctime Makie.colorbuffer(display(fig))
# Runtime
create_time = @benchmark fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @benchmark Makie.colorbuffer(display(fig))
using create display create display
GLMakie 10.95s (10.79, 11.16) 0.13+- 1.15s (1.13, 1.17) 0.02+- 778.53ms (758.78, 834.20) 26.01+- 9.58ms (9.49, 9.73) 0.10+- 139.17ms (136.12, 141.80) 1.95+-
master 11.01s (10.86, 11.18) 0.12+- 1.13s (1.11, 1.15) 0.01+- 765.89ms (757.78, 775.04) 5.37+- 9.60ms (9.51, 9.71) 0.08+- 137.39ms (135.53, 139.54) 1.42+-
evaluation -0.59%, -0.06s invariant (-0.52d, 0.35p, 0.12std) +1.11%, 0.01s invariant (0.82d, 0.15p, 0.02std) +1.62%, 12.63ms invariant (0.67d, 0.25p, 15.69std) -0.24%, -0.02ms invariant (-0.27d, 0.62p, 0.09std) +1.28%, 1.78ms invariant (1.04d, 0.08p, 1.69std)
CairoMakie 9.88s (9.84, 9.95) 0.04+- 1.11s (1.10, 1.13) 0.01+- 208.65ms (207.16, 211.45) 1.45+- 9.50ms (9.41, 9.59) 0.07+- 5.62ms (5.50, 5.72) 0.07+-
master 9.92s (9.86, 10.03) 0.05+- 1.13s (1.11, 1.15) 0.01+- 220.92ms (218.88, 224.00) 2.05+- 9.56ms (9.48, 9.65) 0.06+- 5.73ms (5.68, 5.80) 0.04+-
evaluation -0.38%, -0.04s invariant (-0.78d, 0.17p, 0.05std) -1.05%, -0.01s invariant (-1.01d, 0.08p, 0.01std) -5.88%, -12.27ms faster✅ (-6.92d, 0.00p, 1.75std) -0.59%, -0.06ms invariant (-0.82d, 0.15p, 0.07std) -1.92%, -0.11ms faster ✓ (-1.87d, 0.01p, 0.06std)
WGLMakie 15.99s (15.45, 16.54) 0.41+- 1.54s (1.46, 1.63) 0.06+- 13.76s (13.46, 14.18) 0.26+- 20.95ms (17.84, 31.37) 4.64+- 1.35s (1.24, 1.44) 0.08+-
master 16.07s (15.32, 16.68) 0.45+- 1.53s (1.46, 1.59) 0.05+- 13.80s (13.44, 14.30) 0.34+- 19.98ms (19.50, 20.92) 0.49+- 1.36s (1.30, 1.41) 0.04+-
evaluation -0.52%, -0.08s invariant (-0.19d, 0.73p, 0.43std) +0.42%, 0.01s invariant (0.11d, 0.84p, 0.06std) -0.26%, -0.04s invariant (-0.12d, 0.83p, 0.30std) +4.61%, 0.97ms invariant (0.29d, 0.60p, 2.56std) -0.67%, -0.01s invariant (-0.14d, 0.79p, 0.06std)

Copy link
Member

@jkrumbiegel jkrumbiegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consume(result)?

@ffreyer ffreyer marked this pull request as ready for review October 2, 2023 17:38
@SimonDanisch SimonDanisch merged commit ce5c214 into master Oct 5, 2023
13 checks passed
@SimonDanisch SimonDanisch deleted the ff/fix_scroll_interactions branch October 5, 2023 19:59
SimonDanisch added a commit that referenced this pull request Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants