kopia lustrzana https://github.com/inkstitch/inkstitch
unit: prevent zerodivision error for zero length segments (#3268)
rodzic
3c7d9d4a5a
commit
7c99a138d1
|
@ -303,6 +303,8 @@ class Point:
|
|||
|
||||
def unit(self):
|
||||
length = self.length()
|
||||
if length == 0:
|
||||
return self.__class__(0, 0)
|
||||
return self.__class__(self.x / length, self.y / length)
|
||||
|
||||
def angle(self):
|
||||
|
|
Ładowanie…
Reference in New Issue