(self, element, y, x0, x1)
Get row until given element.
Get row until given element.
Get row until given element .
def _scanline_until(self, element, y, x0, x1):
        """Get row until given element."""
        if x0 == x1:
            return bytematrix.ByteMatrix()
        elif x1 > x0:
            row = self.graph_view[y, x0:x1]
            try:
                # python2 won't do bytearray.index(int)
                index = row.to_bytes().index(int2byte(element))
                return row[:, :index]
            except ValueError:
                return row
        else:
            row = self.graph_view[y, x1+1:x0+1]
            try:
                index = 1 + row.to_bytes().rindex(int2byte(element))
                return row[:, index:]
            except ValueError:
                return row
def _scanline_until ( self , element , y , x0 , x1 ) : if x0 == x1 : return bytematrix . ByteMatrix ( ) elif x1 > x0 : row = self . graph_view [ y , x0 : x1 ] try : # python2 won't do bytearray.index(int) index = row . to_bytes ( ) . index ( int2byte ( element ) ) return row [ : , : index ] except ValueError : return row else : row = self . graph_view [ y , x1 + 1 : x0 + 1 ] try : index = 1 + row . to_bytes ( ) . rindex ( int2byte ( element ) ) return row [ : , index : ] except ValueError : return row