Skip to content

Commit

Permalink
Draft: Fixed undo mode of wires - fixes #2456
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Feb 26, 2016
1 parent 83f87ba commit d387096
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
22 changes: 10 additions & 12 deletions src/Mod/Draft/DraftGui.py
Expand Up @@ -1486,20 +1486,18 @@ def displayPoint(self, point=None, last=None, plane=None, mask=None):
dp = plane.getLocalCoords(point)

# set widgets
if self.mask in ['y','z']:
self.xValue.setText(displayExternal(dp.x,self.DECIMALS,'Length'))
else:
if dp:
if dp:
if self.mask in ['y','z']:
self.xValue.setText(displayExternal(dp.x,self.DECIMALS,'Length'))
if self.mask in ['x','z']:
self.yValue.setText(displayExternal(dp.y,self.DECIMALS,'Length'))
else:
if dp:
else:
self.xValue.setText(displayExternal(dp.x,self.DECIMALS,'Length'))
if self.mask in ['x','z']:
self.yValue.setText(displayExternal(dp.y,self.DECIMALS,'Length'))
if self.mask in ['x','y']:
self.zValue.setText(displayExternal(dp.z,self.DECIMALS,'Length'))
else:
if dp:
else:
self.yValue.setText(displayExternal(dp.y,self.DECIMALS,'Length'))
if self.mask in ['x','y']:
self.zValue.setText(displayExternal(dp.z,self.DECIMALS,'Length'))
else:
self.zValue.setText(displayExternal(dp.z,self.DECIMALS,'Length'))

# set length and angle
Expand Down
5 changes: 2 additions & 3 deletions src/Mod/Draft/DraftTools.py
Expand Up @@ -517,12 +517,11 @@ def undolast(self):
"undoes last line segment"
if (len(self.node) > 1):
self.node.pop()
last = self.node[len(self.node)-1]
last = self.node[-1]
if self.obj.Shape.Edges:
edges = self.obj.Shape.Edges
if len(edges) > 1:
edges.pop()
newshape = Part.Wire(edges)
newshape = Part.makePolygon(self.node)
self.obj.Shape = newshape
else:
self.obj.ViewObject.hide()
Expand Down

0 comments on commit d387096

Please sign in to comment.