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

Multilayer mouse callbacks #6592

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brisvag
Copy link
Contributor

@brisvag brisvag commented Jan 16, 2024

References and relevant issues

Zulip discussion.

Description

Very naive implementation of a multilayer mouse callback system. This has limitations:

  • works well if the selected layers are the same type and have the same mode active
  • works well if selected layers and selected modes have either compatible callbacks for the given mouse event (i.e: points and shapes both add something with click in add mode), or if some layers have NO callback
  • breaks if selected layers have incomplatible callbacks, such as dragging a slicing plane trhough a volume in 3D while another selected layers is in pan_zoom mode

A less naive solution might include some of the following:

  • only working if selected layers have the same type and mode
  • only working if selected layers have the same type, but temporarily set the mode of all other layers to be the same as the active layer until the mouse event is ended
  • never process camera movement events when other types of events are also involved (which is probably 99% of all breaking cases?)

Other than that, this is already pretty usable :)

Copy link

codecov bot commented Jan 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4a1b0b5) 92.27% compared to head (90d2843) 92.14%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6592      +/-   ##
==========================================
- Coverage   92.27%   92.14%   -0.13%     
==========================================
  Files         603      603              
  Lines       53902    53905       +3     
==========================================
- Hits        49736    49669      -67     
- Misses       4166     4236      +70     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

None yet

1 participant