Skip to content

Commit

Permalink
Slider : Fix extra entries in undo queue on drag
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmehl committed Jul 24, 2024
1 parent e9b70c9 commit dfb6b92
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Fixes

- ImageReader : Fixed crash caused by invalid OpenEXR `multiView` attributes.
- LightEditor, RenderPassEditor : Added missing icon representing use of the `CreateIfMissing` tweak mode in the history window.
- Slider : Fixed bug where two undo steps were needed to get back to the original value when dragging.

1.3.16.6 (relative to 1.3.16.5)
========
Expand Down
11 changes: 10 additions & 1 deletion python/GafferUI/Slider.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,11 @@ def __buttonPress( self, widget, event ) :
def __dragBegin( self, widget, event ) :

if event.buttons == GafferUI.ButtonEvent.Buttons.Left and self.getSelectedIndex() is not None :
self.__setValueInternal(
self.getSelectedIndex(),
self.__eventValue( event ),
self.ValueChangedReason.DragBegin
)
return IECore.NullObject.defaultNullObject()

return None
Expand All @@ -450,7 +455,11 @@ def __dragMove( self, widget, event ) :

def __dragEnd( self, widget, event ) :

self.__dragMove( widget, event )
self.__setValueInternal(
self.getSelectedIndex(),
self.__eventValue( event ),
self.ValueChangedReason.DragEnd
)

def __keyPress( self, widget, event ) :

Expand Down

0 comments on commit dfb6b92

Please sign in to comment.