diff --git a/python/GafferUI/ColorChooser.py b/python/GafferUI/ColorChooser.py index 3abd8ad7ef0..b191b252e92 100644 --- a/python/GafferUI/ColorChooser.py +++ b/python/GafferUI/ColorChooser.py @@ -130,6 +130,7 @@ def __init__( self, color, component, dynamicColors = False, **kw ) : self.component = component self.__dynamicColors = dynamicColors self.__gradientToDraw = None + self.__size = self.size() # Sets the slider color in RGB space for RGBA channels, # HSV space for HSV channels and TMI space for TMI channels. @@ -161,7 +162,7 @@ def _drawBackground( self, painter ) : size = self.size() - if self.__gradientToDraw is None : + if self.__gradientToDraw is None or size != self.__size : self.__gradientToDraw = QtGui.QLinearGradient( 0, 0, size.x, 0 ) displayTransform = self.displayTransform() @@ -199,6 +200,7 @@ def _drawBackground( self, painter ) : brush = QtGui.QBrush( self.__gradientToDraw ) painter.fillRect( 0, 0, size.x, size.y, brush ) + self.__size = size def _drawValue( self, painter, value, position, state ) :