Fix white space in boxes/extents.py
now that we mess up the history anyway.
This commit is contained in:
parent
7f1249cb67
commit
4483e483f7
|
@ -4,7 +4,7 @@ class Extents:
|
||||||
def __init__(self,xmin=float('inf'),ymin=float('inf'),xmax=float('-inf'),ymax=float('-inf')):
|
def __init__(self,xmin=float('inf'),ymin=float('inf'),xmax=float('-inf'),ymax=float('-inf')):
|
||||||
self.xmin = xmin
|
self.xmin = xmin
|
||||||
self.ymin = ymin
|
self.ymin = ymin
|
||||||
self.xmax = xmax
|
self.xmax = xmax
|
||||||
self.ymax = ymax
|
self.ymax = ymax
|
||||||
|
|
||||||
def add(self,x,y):
|
def add(self,x,y):
|
||||||
|
@ -19,7 +19,7 @@ class Extents:
|
||||||
|
|
||||||
def __add__(self,extent):
|
def __add__(self,extent):
|
||||||
#todo: why can this happen?
|
#todo: why can this happen?
|
||||||
if extent ==0:
|
if extent == 0:
|
||||||
return Extents(self.xmin,self.ymin,self.xmax,self.ymax)
|
return Extents(self.xmin,self.ymin,self.xmax,self.ymax)
|
||||||
return Extents(
|
return Extents(
|
||||||
min(self.xmin,extent.xmin),min(self.ymin,extent.ymin),
|
min(self.xmin,extent.xmin),min(self.ymin,extent.ymin),
|
||||||
|
@ -30,15 +30,15 @@ class Extents:
|
||||||
if extent == 0:
|
if extent == 0:
|
||||||
return Extents(self.xmin,self.ymin,self.xmax,self.ymax)
|
return Extents(self.xmin,self.ymin,self.xmax,self.ymax)
|
||||||
return self.__add__(extent)
|
return self.__add__(extent)
|
||||||
|
|
||||||
def get_width(self):
|
def get_width(self):
|
||||||
return self.xmax-self.xmin
|
return self.xmax-self.xmin
|
||||||
|
|
||||||
def get_height(self):
|
def get_height(self):
|
||||||
return self.ymax-self.ymin
|
return self.ymax-self.ymin
|
||||||
|
|
||||||
width = property(get_width)
|
width = property(get_width)
|
||||||
height = property(get_height)
|
height = property(get_height)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return f'Extents ({self.xmin},{self.ymin})-({self.xmax},{self.ymax})'
|
return f'Extents ({self.xmin},{self.ymin})-({self.xmax},{self.ymax})'
|
||||||
|
|
Loading…
Reference in New Issue