forked from K0lb3/UnityPy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRectangle.py
More file actions
40 lines (32 loc) · 878 Bytes
/
Copy pathRectangle.py
File metadata and controls
40 lines (32 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
class Rectangle:
#height : int
#width : int
#x : int
#y : int
def __init__(self, *args, **kwargs):
if args:
#Rectangle(Point, Size)
if len(args) == 4:
self.x, self.y, self.width, self.height = args
elif kwargs:
self.__dict__.update(kwargs)
def round(rect):
return Rectangle(round(rect.x), round(rect.y), round(rect.width), round(rect.height))
@property
def left(self):
return self.x
@property
def top(self):
return self.y
@property
def right(self):
return self.x + self.width
@property
def bottom(self):
return self.y + self.height
@property
def size(self):
return (self.width, self.height)
@property
def location(self):
return (self.x, self.y)