Skip to content

Commit

Permalink
Draft: small fix in point object
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Feb 13, 2014
1 parent 37f283e commit 478772f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
12 changes: 11 additions & 1 deletion src/Mod/Draft/Draft.py
Expand Up @@ -1101,7 +1101,17 @@ def move(objectslist,vector,copy=False):
if not isinstance(objectslist,list): objectslist = [objectslist]
newobjlist = []
for obj in objectslist:
if (obj.isDerivedFrom("Part::Feature")):
if getType(obj) == "Point":
v = Vector(obj.X,obj.Y,obj.Z)
v = v.add(vector)
if copy:
newobj = makeCopy(obj)
else:
newobj = obj
newobj.X = v.x
newobj.Y = v.y
newobj.Z = v.z
elif (obj.isDerivedFrom("Part::Feature")):
if copy:
newobj = makeCopy(obj)
else:
Expand Down
7 changes: 4 additions & 3 deletions src/Mod/Draft/DraftTools.py
Expand Up @@ -1993,12 +1993,13 @@ def move(self,delta,copy=False):
if copy:
self.commit(translate("draft","Copy"),
['import Draft',
'Draft.move('+sel+','+DraftVecUtils.toString(delta)+',copy='+str(copy)+')'])
'Draft.move('+sel+','+DraftVecUtils.toString(delta)+',copy='+str(copy)+')',
'FreeCAD.ActiveDocument.recompute()'])
else:
self.commit(translate("draft","Move"),
['import Draft',
'Draft.move('+sel+','+DraftVecUtils.toString(delta)+',copy='+str(copy)+')'])
self.doc.recompute()
'Draft.move('+sel+','+DraftVecUtils.toString(delta)+',copy='+str(copy)+')',
'FreeCAD.ActiveDocument.recompute()'])

def action(self,arg):
"scene event handler"
Expand Down

0 comments on commit 478772f

Please sign in to comment.