Try to fix up breakGroup.
With the new CursesReporter, I'm able to observe groups getting built
and broken; and I observed that sometimes a Bond (between a Letter and
a Group) would apparently survive the Group's breaking.
Reorder the operations in `breakGroup` so that the higher-level ones
("detach this Group from its external bonds") come strictly before
the lower-level ones ("ungroup this Group's members and remove this
Group from the Workspace, thus destroying it").
However, the "buggy" behavior I observed turned out to be due to a bug
in my display code and not due to anything wrong with `breakGroup`.
I suspect this patch is actually purely cosmetic.
This commit is contained in:
@ -140,25 +140,26 @@ class Group(WorkspaceObject):
|
|||||||
|
|
||||||
def breakGroup(self):
|
def breakGroup(self):
|
||||||
workspace = self.ctx.workspace
|
workspace = self.ctx.workspace
|
||||||
|
if self.correspondence:
|
||||||
|
self.correspondence.breakCorrespondence()
|
||||||
|
if self.group:
|
||||||
|
self.group.breakGroup()
|
||||||
|
if self.leftBond:
|
||||||
|
self.leftBond.breakBond()
|
||||||
|
if self.rightBond:
|
||||||
|
self.rightBond.breakBond()
|
||||||
|
|
||||||
while len(self.descriptions):
|
while len(self.descriptions):
|
||||||
description = self.descriptions[-1]
|
description = self.descriptions[-1]
|
||||||
description.breakDescription()
|
description.breakDescription()
|
||||||
for objekt in self.objectList:
|
for o in self.objectList:
|
||||||
objekt.group = None
|
o.group = None
|
||||||
if self.group:
|
|
||||||
self.group.breakGroup()
|
|
||||||
if self in workspace.structures:
|
if self in workspace.structures:
|
||||||
workspace.structures.remove(self)
|
workspace.structures.remove(self)
|
||||||
if self in workspace.objects:
|
if self in workspace.objects:
|
||||||
workspace.objects.remove(self)
|
workspace.objects.remove(self)
|
||||||
if self in self.string.objects:
|
if self in self.string.objects:
|
||||||
self.string.objects.remove(self)
|
self.string.objects.remove(self)
|
||||||
if self.correspondence:
|
|
||||||
self.correspondence.breakCorrespondence()
|
|
||||||
if self.leftBond:
|
|
||||||
self.leftBond.breakBond()
|
|
||||||
if self.rightBond:
|
|
||||||
self.rightBond.breakBond()
|
|
||||||
|
|
||||||
def updateInternalStrength(self):
|
def updateInternalStrength(self):
|
||||||
slipnet = self.ctx.slipnet
|
slipnet = self.ctx.slipnet
|
||||||
|
|||||||
Reference in New Issue
Block a user