#NEWLINE# def _child_dragged( self , child ) : #NEWLINE# #INDENT# assert ( child == self . thumb ) #NEWLINE# if ( self . direction == VERTICAL ) : #NEWLINE# #INDENT# self . thumb . frame . centerx = ( self . frame . w // 2 ) #NEWLINE# self . thumb . frame . top = max ( 0 , self . thumb . frame . top ) #NEWLINE# self . thumb . frame . bottom = min ( self . frame . h , self . thumb . frame . bottom ) #NEWLINE# percent_px = ( self . thumb . frame . centery - ( self . thumb . frame . h // 2 ) ) #NEWLINE# height = ( self . frame . h - self . thumb . frame . h ) #NEWLINE# t = ( percent_px / float ( height ) ) #NEWLINE# value = ( self . high + ( t * ( self . low - self . high ) ) ) #NEWLINE# self . _set_value ( value , False ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . thumb . frame . centery = ( self . frame . h // 2 ) #NEWLINE# self . thumb . frame . left = max ( 0 , self . thumb . frame . left ) #NEWLINE# self . thumb . frame . right = min ( self . frame . w , self . thumb . frame . right ) #NEWLINE# percent_px = ( self . thumb . frame . centerx - ( self . thumb . frame . w // 2 ) ) #NEWLINE# width = ( self . frame . w - self . thumb . frame . w ) #NEWLINE# t = ( percent_px / float ( width ) ) #NEWLINE# value = ( self . low + ( t * ( self . high - self . low ) ) ) #NEWLINE# self . _set_value ( value , False )