diff --git a/masque/shapes/path.py b/masque/shapes/path.py index d4c7b24..706e2f4 100644 --- a/masque/shapes/path.py +++ b/masque/shapes/path.py @@ -265,6 +265,14 @@ class Path(Shape): if self.cap_extensions is None: return True return tuple(self.cap_extensions) < tuple(other.cap_extensions) + if not numpy.array_equal(self.vertices, other.vertices): + min_len = min(self.vertices.shape[0], other.vertices.shape[0]) + eq_mask = self.vertices[:min_len] != other.vertices[:min_len] + eq_lt = self.vertices[:min_len] < other.vertices[:min_len] + eq_lt_masked = eq_lt[eq_mask] + if eq_lt_masked.size > 0: + return eq_lt_masked.flat[0] + return self.vertices.shape[0] < other.vertices.shape[0] if self.repetition != other.repetition: return rep2key(self.repetition) < rep2key(other.repetition) return annotations_lt(self.annotations, other.annotations)