Skip to content

Commit 6c92eff

Browse files
committed
Animation editor: Fix crash when dragging frames.
1 parent bec1111 commit 6c92eff

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/gui.gloa

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ local register :: (state:State, el:Element, T:Type) -> Element {
249249
return el
250250
}
251251

252-
local unregisterTree :: (state:State, el:Element) {
253-
do {
252+
local unregisterTree :: (state:State, el:Element, updateInteractions:bool) {
253+
if updateInteractions { -- @Hack!
254254
if state.focusId == el.id state.blurFocus!(abort=false)
255255
if state.activeId == el.id state.cancelMouseActions!()
256256

@@ -269,7 +269,7 @@ local unregisterTree :: (state:State, el:Element) {
269269
remove(state.scrollables, i)
270270
}
271271

272-
for el unregisterTree(state, it)
272+
for el unregisterTree(state, it, updateInteractions)
273273
}
274274

275275

@@ -3383,22 +3383,22 @@ export hideContextMenu :: (state:State, mayDeactivateSubmenu=false) -> (success:
33833383

33843384

33853385

3386-
export delete :: (state:State, el:Element) {
3386+
export delete :: (state:State, el:Element, updateInteractions=true) {
33873387
updateLayoutIfNeeded(state) -- Needed for parents. @Speed
33883388

33893389
if el.type == Frame {
33903390
local frame = cast(Frame) el
33913391
local found, i = indexOf(state.frames, frame)
33923392
if not found return
33933393

3394-
unregisterTree(state, frame)
3394+
unregisterTree(state, frame, updateInteractions)
33953395
remove(state.frames, i)
33963396

33973397
} else {
33983398
local found, i = indexOf(el.parent, el)
33993399
if not found return
34003400

3401-
unregisterTree(state, el)
3401+
unregisterTree(state, el, updateInteractions)
34023402
remove(el.parent, i)
34033403
}
34043404
}

src/guiSetup.gloa

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3687,7 +3687,7 @@ export setupGuiCallbacks :: () {
36873687
guiState.onRefresh.animation_frames = (vbox:gui.Vbox) {
36883688
local project, system = getCurrentProjectAndSystem()
36893689

3690-
for < vbox guiState.delete!(it)
3690+
for < vbox guiState.delete!(it, updateInteractions=false)
36913691

36923692
for system.frames {
36933693
local inputValue = format("%s %s %s %s", it.x, it.y, it.w, it.h)

0 commit comments

Comments
 (0)