From 728067cab6ba67dc76015db4c9695d431fbed598 Mon Sep 17 00:00:00 2001 From: DeepSOIC Date: Sun, 1 Nov 2015 21:14:23 +0300 Subject: [PATCH] ShapeString: use non-presicion boundbox by default For speed. It takes horribly long to compute precision bounding box of a string of anything longer than about 5 characters. --- latticeShapeString.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/latticeShapeString.py b/latticeShapeString.py index 1c39670..e3f20ee 100644 --- a/latticeShapeString.py +++ b/latticeShapeString.py @@ -117,6 +117,8 @@ class LatticeShapeString: obj.addProperty("App::PropertyEnumeration","YAlign","Lattice ShapeString","Vertical alignment of individual strings") obj.YAlign = ['None','Top','Bottom','Middle'] + + obj.addProperty("App::PropertyBool","AlignPrecisionBoundBox","Lattice ShapeString","Use precision bounding box for alignment. Warning: slow!") obj.addProperty("App::PropertyFile","FullPathToFont","Lattice ShapeString","Full path of font file that is actually being used.") obj.setEditorMode("FullPathToFont", 1) # set read-only @@ -163,7 +165,10 @@ class LatticeShapeString: if obj.XAlign == 'None' and obj.YAlign == 'None': pass #need not calculate boundbox else: - bb = getPrecisionBoundBox(shape) + if obj.AlignPrecisionBoundBox: + bb = getPrecisionBoundBox(shape) + else: + bb = shape.BoundBox alignPnt = App.Vector()