-
Notifications
You must be signed in to change notification settings - Fork 43
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
2482 problem with dragging slicer elements on plot #2515
Conversation
This fixes the error due to the confusion between base and base.base which had all interactors redraw the plot first and updating from the move second. This was resolved in the "moveend" method but made using the mouse to set the interactor rather difficult to do precisely. This was also cleanded up in the three interactor/slicer modules not currently used but that probably will be for the needs of the magnetic/crystal scattering communities. Duplicate draws were removed when appropriate.
First pass at fixing the slicer classes docstrings.
There are three unused slicer modules that are set up for wedge type slicers. These were never implemented. I suspect that in fact it was orinally planed to use this for sector averaging where perhaps the wedge became a sector by making r1=0 and r2 = qmax. However as it stands it left two slicers classes called SectorInteractor. This unused class is renamed to the more appropriate WedgeInteractor in preparation for being used for crystal type data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still seeing jumping in both the rectangular averaging and sector slicers. Also, for the sector slicer, the left line can no longer be consistently moved.
@butlerpd to look at it. |
@butlerpd to look at it |
@butlerpd will fix at least one issue |
…'left' and 'right' are set correctly when calling SideInteractor.update().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good.
The fix does indeed work - on mouse button release, the slicer line/circle no longer jumps.
This was especially visible when the final position of the cursor was not on the line itself.
# Check if the left side has moved and update the slicer accordingly | ||
if self.left_line.has_move: | ||
self.main_line.update() | ||
self.left_line.update(phi=None, delta=None, mline=self.main_line, | ||
side=True, left=True) | ||
self.right_line.update(phi=self.left_line.phi, delta=None, | ||
mline=self.main_line, side=True, | ||
left=False, right=True) | ||
mline=self.main_line, side=True, right=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary? The default value of left
is False
so you probably don't need to explicitly set it
# Check if the right side line has moved and update the slicer accordingly | ||
if self.right_line.has_move: | ||
self.main_line.update() | ||
self.right_line.update(phi=None, delta=None, mline=self.main_line, | ||
side=True, left=False, right=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above
…Also added back a superfluous self.update() call for consistency with the other slicers.
I would like to review this a bit more closely as the fix suggests some possible deeper problems in the code. Since we are now working heavily on this bit, it is worth checking this out I think. |
Everything in this PR is in #2566 - I'm closing it. |
Description
The main thing this does is to Fix #2482 by making sure the plot is updated first and then drawn on drag operations for all slicere. In the process 2 other commits were made to
Fixes #2482
How Has This Been Tested?
the functional changes were tested by following the steps described in the issue this fixes and verifying that the behavior is now as expected.
Review Checklist (please remove items if they don't apply):