Просмотр исходного кода

Fixed mirroring list of geometries

Zheng, Lei 9 лет назад
Родитель
Сommit
8a43a63b80
1 измененных файлов с 9 добавлено и 4 удалено
  1. 9 4
      camlib.py

+ 9 - 4
camlib.py

@@ -928,11 +928,16 @@ class Geometry(object):
         px, py = point
         xscale, yscale = {"X": (1.0, -1.0), "Y": (-1.0, 1.0)}[axis]
 
-        ## solid_geometry ???
-        #  It's a cascaded union of objects.
-        self.solid_geometry = affinity.scale(self.solid_geometry,
-                                             xscale, yscale, origin=(px, py))
+        def mirror_geom(obj):
+            if type(obj) is list:
+                new_obj = []
+                for g in obj:
+                    new_obj.append(mirror_geom(g))
+                return new_obj
+            else:
+                return affinity.scale(obj,xscale,yscale,origin=(px,py))
 
+        self.solid_geometry = mirror_geom(self.solid_geometry)
 
 class ApertureMacro:
     """