Skip to content

Commit

Permalink
Fixed bug with child not deleting correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Claydough6 committed May 6, 2021
1 parent 0416273 commit d99a2f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion resolution_gui/clause_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self, app, canvas, master=None, **kwargs):
self.canvas = canvas

self.parents = list()
self.child = None
self.child = list()
self.premise_index = None

self.state = None
Expand Down
8 changes: 4 additions & 4 deletions resolution_gui/resolution_canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def kill_clause(self, *args):
to_delete.append((start, end))
if end == selected:
this = self.frames[start]
this.child = None
this.child.remove(end)
# undraw the line
to_delete.append((start, end))
self.delete(selected)
Expand Down Expand Up @@ -114,16 +114,16 @@ def frame_click(self, frame_id):
if clicked in this.parents:
# remove the other from this parents
this.parents.remove(clicked)
other.child = None
other.child.remove(this)
# if no parents, update state
if len(this.parents) == 0:
this.state = None
# undraw the line
self.remove_line(clicked, selected)
elif len(this.parents) < 2 and other.child == None:
elif len(this.parents) < 2:
# update the parents
this.parents.append(clicked)
other.child = this
other.child.append(selected)
# update the state to regualar clause
this.state = "clause"
# draw the line between the two
Expand Down

0 comments on commit d99a2f0

Please sign in to comment.