#NEWLINE# def on_touch_move( self , touch ) : #NEWLINE# #INDENT# if ( touch . grab_current != self ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# p = self . page #NEWLINE# border = self . border #NEWLINE# half_border = ( border / 2.0 ) #NEWLINE# page = self . children [ ( ( - p ) - 1 ) ] #NEWLINE# if ( touch . ud [ 'page' ] == 'previous' ) : #NEWLINE# #INDENT# if ( p < ( len ( self . children ) - 1 ) ) : #NEWLINE# #INDENT# self . children [ ( ( - p ) - 2 ) ] . x = min ( ( self . right - ( self . border * ( 1 - ( touch . sx - touch . osx ) ) ) ) , self . right ) #NEWLINE# #UNINDENT# if ( p >= 1 ) : #NEWLINE# #INDENT# b_right = ( half_border if ( p > 1 ) else border ) #NEWLINE# b_left = ( half_border if ( p < ( len ( self . children ) - 1 ) ) else border ) #NEWLINE# self . children [ ( ( - p ) - 1 ) ] . x = max ( min ( ( ( self . x + b_left ) + ( touch . x - touch . ox ) ) , ( self . right - b_right ) ) , ( self . x + b_left ) ) #NEWLINE# #UNINDENT# if ( p > 1 ) : #NEWLINE# #INDENT# self . children [ ( - p ) ] . x = min ( ( self . x + ( half_border * ( touch . sx - touch . osx ) ) ) , ( self . x + half_border ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( touch . ud [ 'page' ] == 'next' ) : #NEWLINE# #INDENT# if ( p >= 1 ) : #NEWLINE# #INDENT# self . children [ ( ( - p ) - 1 ) ] . x = max ( ( self . x + ( half_border * ( 1 - ( touch . osx - touch . sx ) ) ) ) , self . x ) #NEWLINE# #UNINDENT# if ( p < ( len ( self . children ) - 1 ) ) : #NEWLINE# #INDENT# b_right = ( half_border if ( p >= 1 ) else border ) #NEWLINE# b_left = ( half_border if ( p < ( len ( self . children ) - 2 ) ) else border ) #NEWLINE# self . children [ ( ( - p ) - 2 ) ] . x = min ( max ( ( ( self . right - b_right ) + ( touch . x - touch . ox ) ) , ( self . x + b_left ) ) , ( self . right - b_right ) ) #NEWLINE# #UNINDENT# if ( p < ( len ( self . children ) - 2 ) ) : #NEWLINE# #INDENT# self . children [ ( ( - p ) - 3 ) ] . x = max ( ( self . right + ( half_border * ( touch . sx - touch . osx ) ) ) , ( self . right - half_border ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return page . on_touch_move ( touch )