-
Notifications
You must be signed in to change notification settings - Fork 207
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
Color Chooser Constrain Drag #6128
base: 1.5_maintenance
Are you sure you want to change the base?
Color Chooser Constrain Drag #6128
Conversation
Thanks Eric! I wonder if we should consider constraining based on the current value when I think for this to make sense we'd also need to change the constraint overlay to be visible when |
That does sound like a good interaction, I'll make that change and see how it works. I tended to start from a click and drag the indicator rather than click on the opposite side, but was probably getting some small unintended changes like you were. |
2b1c4ea
to
b04ac05
Compare
b04ac05
to
068e77d
Compare
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.
Thanks Eric! The interaction is feeling much better with these latest changes. I have one question inline about the snap to center behaviour but otherwise we're looking pretty close.
In 172bb57 I removed the near-center snapping behavior, and made what is hopefully the final tweak to dragging. Previously, I was using the distance from center as the saturation / value constraint to the radius line. That meant that if you were dragging from the opposite side of the circle from the start point, far from the center, you'd get a sudden snap to close to the end of the constraint line as soon as you crossed back to the same side of the circle as the start point. 172bb57 constrains the point to the closest point on the radius line, making for a smooth transition when crossing sides at any position. |
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.
Thanks! The removal of the snapping works great for me. A pair of final nitpicks inline, but they can be squashed in while preparing to merge.
172bb57
to
138b009
Compare
138b009
to
ca59522
Compare
def __init__( self, color = imath.Color3f( 1.0 ), staticComponent = "v", dynamicBackground = True, **kw ) : | ||
__DragConstraints = enum.Flag( "__DragConstraints", [ "X", "Y" ] ) | ||
|
||
def __init__( self, color = imath.Color3f( 1.0 ), staticComponent = "v", dynamicBackground = False, **kw ) : |
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.
Somewhere along the way we've ended up with dynamicBackground = False
here.
This lets users constrain dragging in the color field to a single axis (or circle if the wheel is the current widget) by holding the
Control
key.Checklist