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.
This commit is contained in:
parent
fc2fc61532
commit
728067cab6
|
@ -118,6 +118,8 @@ class LatticeShapeString:
|
||||||
obj.addProperty("App::PropertyEnumeration","YAlign","Lattice ShapeString","Vertical alignment of individual strings")
|
obj.addProperty("App::PropertyEnumeration","YAlign","Lattice ShapeString","Vertical alignment of individual strings")
|
||||||
obj.YAlign = ['None','Top','Bottom','Middle']
|
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.addProperty("App::PropertyFile","FullPathToFont","Lattice ShapeString","Full path of font file that is actually being used.")
|
||||||
obj.setEditorMode("FullPathToFont", 1) # set read-only
|
obj.setEditorMode("FullPathToFont", 1) # set read-only
|
||||||
|
|
||||||
|
@ -163,7 +165,10 @@ class LatticeShapeString:
|
||||||
if obj.XAlign == 'None' and obj.YAlign == 'None':
|
if obj.XAlign == 'None' and obj.YAlign == 'None':
|
||||||
pass #need not calculate boundbox
|
pass #need not calculate boundbox
|
||||||
else:
|
else:
|
||||||
|
if obj.AlignPrecisionBoundBox:
|
||||||
bb = getPrecisionBoundBox(shape)
|
bb = getPrecisionBoundBox(shape)
|
||||||
|
else:
|
||||||
|
bb = shape.BoundBox
|
||||||
|
|
||||||
alignPnt = App.Vector()
|
alignPnt = App.Vector()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user