Skip to content

Commit

Permalink
Arch: simplified window's Host touch system
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Mar 9, 2018
1 parent 0d00433 commit fe0ecd9
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/Mod/Arch/ArchWindow.py
Expand Up @@ -650,20 +650,19 @@ def __init__(self,obj):

def onChanged(self,obj,prop):
self.hideSubobjects(obj,prop)
if prop == "Hosts":
if hasattr(obj,"Hosts"):
for host in obj.Hosts:
# mark host to recompute so it can detect this object
host.touch()
if not "Restore" in obj.State:
if prop in ["Base","WindowParts"]:
self.execute(obj)
self.onChanged(obj,"Hosts")
elif prop in ["HoleDepth"]:
for o in obj.InList:
if Draft.getType(o) in AllowedHosts:
o.Proxy.execute(o)
self.onChanged(obj,"Hosts")
if prop in ["Base","WindowParts","Placement","HoleDepth","Height","Width"]:
# anti-recursive loops, bc the base sketch will touch the Placement all the time
ok = True
if prop == "Placement":
if hasattr(self,"Placement"):
if self.Placement == obj.Placement:
ok = False
self.Placement = FreeCAD.Placement(obj.Placement)
if ok and hasattr(obj,"Hosts"):
for host in obj.Hosts:
# mark host to recompute so it can detect this object
host.touch()
if prop in ["Width","Height"]:
if obj.Preset != 0:
if obj.Base:
Expand All @@ -684,7 +683,6 @@ def onChanged(self,obj,prop):
# restoring constraints when loading a file fails
# because of load order, but it doesn't harm...
pass
self.onChanged(obj,"Hosts")
else:
ArchComponent.Component.onChanged(self,obj,prop)

Expand Down

0 comments on commit fe0ecd9

Please sign in to comment.