parameters: (self, tabPoints, y, style)
return_statement: return int(x)
docstring: Returns the x start position of a tab.
docstring_summary: Returns the x start position of a tab.
docstring_tokens: Returns the x start position of a tab .
function: def GetStartX(self, tabPoints, y, style):
          """ Returns the x start 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(3):
                  
                  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(3):
                  
                  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[2].x
  
          # According to the equation y = ax + b => x = (y-b)/a
          # We know the first 2 points
  
          if x2 == x1:
              return x2
          else:
              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 GetStartX ( 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 ( 3 ) : 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 ( 3 ) : 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 [ 2 ] . x # According to the equation y = ax + b => x = (y-b)/a # We know the first 2 points if x2 == x1 : return x2 else : 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 )