Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6686,7 +6686,7 @@ def uri(self):


class Matrix:

__slots__ = ("a", "b", "c", "d", "e", "f", )
def __abs__(self):
return math.sqrt(sum([c*c for c in self]))

Expand Down Expand Up @@ -10785,7 +10785,7 @@ def __del__(self):

del Point
class Point:

__slots__ = ("x", "y")
def __abs__(self):
return math.sqrt(self.x * self.x + self.y * self.y)

Expand Down Expand Up @@ -10972,7 +10972,7 @@ def unit(self):


class Quad:

__slots__ = ("ul", "ur", "ll", "lr")
def __abs__(self):
if self.is_empty:
return 0.0
Expand Down Expand Up @@ -11036,6 +11036,7 @@ def __init__(self, *args, ul=None, ur=None, ll=None, lr=None):
None.

'''

if not args:
self.ul = self.ur = self.ll = self.lr = Point()
elif len(args) > 4:
Expand Down Expand Up @@ -11204,7 +11205,7 @@ def transform(self, m):


class Rect:

__slots__ = ("x0", "y0", "x1", "y1")
def __abs__(self):
if self.is_empty or self.is_infinite:
return 0.0
Expand Down Expand Up @@ -12647,7 +12648,7 @@ class IRect:
IRect(top-left, bottom-right) - 2 points
IRect(sequ) - new from sequence or rect-like
"""

__slots__ = ("x0", "y0", "x1", "y1")
def __add__(self, p):
return Rect.__add__(self, p).round()

Expand Down
Loading