[Path] improve __lt__ for endcaps
This commit is contained in:
parent
9296011d4b
commit
e3f8d28529
1 changed files with 10 additions and 1 deletions
|
|
@ -24,7 +24,16 @@ class PathCap(Enum):
|
||||||
# # defined by path.cap_extensions
|
# # defined by path.cap_extensions
|
||||||
|
|
||||||
def __lt__(self, other: Any) -> bool:
|
def __lt__(self, other: Any) -> bool:
|
||||||
return self.value == other.value
|
if self.__class__ is not other.__class__:
|
||||||
|
return self.__class__.__name__ < other.__class__.__name__
|
||||||
|
# Order: Flush, Square, Round, SquareCustom, Circle
|
||||||
|
order = {
|
||||||
|
PathCap.Flush: 0,
|
||||||
|
PathCap.Square: 1,
|
||||||
|
PathCap.Circle: 2,
|
||||||
|
PathCap.SquareCustom: 3,
|
||||||
|
}
|
||||||
|
return order[self] < order[other]
|
||||||
|
|
||||||
|
|
||||||
@functools.total_ordering
|
@functools.total_ordering
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue