parameters: (self, tabPoints, y, style)
return_statement: return int(x)
docstring: Returns the x end position of a tab.
docstring_summary: Returns the x end position of a tab.
docstring_tokens: Returns the x end position of a tab .
function: def GetEndX(self, tabPoints, y, style):
          """ Returns the x end position of a tab. """
  
          x1, x2, y1, y2 = 0.0, 0.0, 0.0, 0.0
  
          # We check the 3 points to the left
          bBottomStyle = (style & FNB_BOTTOM and [True] or [False])[0]
          match = False
  
          if bBottomStyle:
  
              for i in xrange(7, 3, -1):
                  
                  if y >= tabPoints[i].y and y < tabPoints[i-1].y:
                  
                      x1 = tabPoints[i].x
                      x2 = tabPoints[i-1].x
                      y1 = tabPoints[i].y
                      y2 = tabPoints[i-1].y
                      match = True
                      break
          
          else:
          
              for i in xrange(7, 3, -1):
                  
                  if y <= tabPoints[i].y and y > tabPoints[i-1].y:
                  
                      x1 = tabPoints[i].x
                      x2 = tabPoints[i-1].x
                      y1 = tabPoints[i].y
                      y2 = tabPoints[i-1].y
                      match = True
                      break
  
          if not match:
              return tabPoints[3].x
  
          # According to the equation y = ax + b => x = (y-b)/a
          # We know the first 2 points
  
          # Vertical line
          if x1 == x2:
              return int(x1)
          
          a = (y2 - y1)/(x2 - x1)
          b = y1 - ((y2 - y1)/(x2 - x1))*x1
  
          if a == 0:
              return int(x1)
  
          x = (y - b)/a
  
          return int(x)
function_tokens: def GetEndX ( self , tabPoints , y , style ) : x1 , x2 , y1 , y2 = 0.0 , 0.0 , 0.0 , 0.0 # We check the 3 points to the left bBottomStyle = ( style & FNB_BOTTOM and [ True ] or [ False ] ) [ 0 ] match = False if bBottomStyle : for i in xrange ( 7 , 3 , - 1 ) : if y >= tabPoints [ i ] . y and y < tabPoints [ i - 1 ] . y : x1 = tabPoints [ i ] . x x2 = tabPoints [ i - 1 ] . x y1 = tabPoints [ i ] . y y2 = tabPoints [ i - 1 ] . y match = True break else : for i in xrange ( 7 , 3 , - 1 ) : if y <= tabPoints [ i ] . y and y > tabPoints [ i - 1 ] . y : x1 = tabPoints [ i ] . x x2 = tabPoints [ i - 1 ] . x y1 = tabPoints [ i ] . y y2 = tabPoints [ i - 1 ] . y match = True break if not match : return tabPoints [ 3 ] . x # According to the equation y = ax + b => x = (y-b)/a # We know the first 2 points # Vertical line if x1 == x2 : return int ( x1 ) a = ( y2 - y1 ) / ( x2 - x1 ) b = y1 - ( ( y2 - y1 ) / ( x2 - x1 ) ) * x1 if a == 0 : return int ( x1 ) x = ( y - b ) / a return int ( x )