Closed DanGonite57 closed 1 month ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 92.43%. Comparing base (
1dcbade
) to head (30e10e4
). Report is 1 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Yup, can't reproduce the issue with this PR, so seems good.
References and relevant issues
Contributes towards https://github.com/napari/napari/issues/6746
Description
The
Points.selected_data
setter calls_set_highlight
itself before returning. In the two bulk-selection/deselection keybindings,_set_highlight
is also called, essentially immediately after the setter, resulting in duplication of work and non-negligible overhead particularly with large numbers of points.bench.py
Before:
After:
This change may clash with previous fix https://github.com/napari/napari/pull/5771. However, I don't seem to have been able to visually reproduce any difference between
_set_highlight()
,_set_highlight(force=true)
, or this removal under the conditions highlighted in the issue, so something may have changed somewhere else since then. From my brief understanding, at present using the keybinds will always change the set of selected points, which means that highlights will always be re-rendered regardless offorce
(unless there are no points, in which case there will be no points to change the selection/highlighting of either).