From da7118f521667073147b656668c5e81d669e44cb Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Mon, 29 Jul 2024 03:13:36 -0700 Subject: [PATCH] misc cleanup --- masque/repetition.py | 6 +++--- masque/shapes/text.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/masque/repetition.py b/masque/repetition.py index be77ab8..a365909 100644 --- a/masque/repetition.py +++ b/masque/repetition.py @@ -332,9 +332,9 @@ class Arbitrary(Repetition): @displacements.setter def displacements(self, val: ArrayLike) -> None: - vala: NDArray[numpy.float64] = numpy.array(val, dtype=float) - vala = numpy.sort(vala.view([('', vala.dtype)] * vala.shape[1]), 0).view(vala.dtype) # sort rows - self._displacements = vala + vala = numpy.array(val, dtype=float) + order = numpy.lexsort(vala.T[::-1]) # sortrows + self._displacements = vala[order] def __init__( self, diff --git a/masque/shapes/text.py b/masque/shapes/text.py index fa0038b..e936796 100644 --- a/masque/shapes/text.py +++ b/masque/shapes/text.py @@ -230,7 +230,8 @@ def get_char_as_polygons( outline = slot.outline start = 0 - all_verts_list, all_codes = [], [] + all_verts_list = [] + all_codes = [] for end in outline.contours: points = outline.points[start:end + 1] points.append(points[0])