(self, x0, y0, x1, y1, attr, pattern, mask)
return mask
Draw a horizontal or vertical line.
Draw a horizontal or vertical line.
Draw a horizontal or vertical line .
def _draw_straight(self, x0, y0, x1, y1, attr, pattern, mask):
        """Draw a horizontal or vertical line."""
        if x0 == x1:
            p0, p1, q, direction = y0, y1, x0, 'y'
        else:
            p0, p1, q, direction = x0, x1, y0, 'x'
        sp = 1 if p1 > p0 else -1
        for p in range(p0, p1+sp, sp):
            if pattern & mask != 0:
                if direction == 'x':
                    self.graph_view[q, p] = attr
                else:
                    self.graph_view[p, q] = attr
            mask >>= 1
            if mask == 0:
                mask = 0x8000
        return mask
def _draw_straight ( self , x0 , y0 , x1 , y1 , attr , pattern , mask ) : if x0 == x1 : p0 , p1 , q , direction = y0 , y1 , x0 , 'y' else : p0 , p1 , q , direction = x0 , x1 , y0 , 'x' sp = 1 if p1 > p0 else - 1 for p in range ( p0 , p1 + sp , sp ) : if pattern & mask != 0 : if direction == 'x' : self . graph_view [ q , p ] = attr else : self . graph_view [ p , q ] = attr mask >>= 1 if mask == 0 : mask = 0x8000 return mask