Draft: Fix offsets.py problem with direction if precision=6

The direction of the offset could be faulty if Draft precision=6. Since we are only interested in the side the pointer is on, working with a high precision does not make sense.
This commit is contained in:
Roy-043
2021-06-15 17:37:21 +02:00
committed by GitHub
parent 728c001421
commit df5c24bc63

View File

@@ -295,13 +295,14 @@ def offsetWire(wire, dvec, bind=False, occ=False,
# check against dvec provided for the offset direction
# would not know if dvec is vector of width (Left/Right Align)
# or width/2 (Center Align)
dvec0 = DraftVecUtils.scaleTo(v0, dvec.Length)
if DraftVecUtils.equals(dvec0, dvec):
v0.normalize()
v1 = App.Vector(dvec).normalize()
if v0.isEqual(v1, 0.0001):
# "Left Offset" (Left Align or 'left offset' in Centre Align)
firstDir = 1
firstAlign = 'Left'
alignListC.append('Left')
elif DraftVecUtils.equals(dvec0, dvec.negative()):
elif v0.isEqual(v1.negative(), 0.0001):
# "Right Offset" (Right Align or 'right offset' in Centre Align)
firstDir = -1
firstAlign = 'Right'