Added ability to resize windows from all sides and corners.

This commit is contained in:
Joey Payne 2014-01-31 22:37:08 -07:00
commit 22e86812e8
3 changed files with 145 additions and 20 deletions

View file

@ -81,6 +81,11 @@ class Position(StructureBase):
other = Position.from_value(other)
return Position(self.x-other.x, self.y-other.y)
def __mul__(self, value):
if isinstance(value, (int, long, float)):
return Position(self.x*value, self.y*value)
raise Exception("Cannot multiply position by {}.".format(value.__class__.__name__))
def __iter__(self):
yield self.x
yield self.y