Skip to content

Commit

Permalink
[feenkcom/gtoolkit#3206] when attaching a removed child we should dis…
Browse files Browse the repository at this point in the history
…patch that it was added to the scene graph
  • Loading branch information
syrel committed Apr 13, 2023
1 parent b32da37 commit 0853036
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/Bloc/BlElement.class.st
Expand Up @@ -492,7 +492,7 @@ BlElement >> attachChild: anElement at: anIndex [
eachElement isRemovedFromSceneGraph
ifTrue: [
eachElement attachSpace.
eachElement onAddedToSceneGraph ] ] ]
eachElement dispatchAddedToSceneGraph ] ] ]
]

{ #category : #'api - space' }
Expand Down Expand Up @@ -1206,8 +1206,10 @@ BlElement >> dispatchAddedToSceneGraph [
self
assert: [ self isAttachedToSceneGraph ]
description: [ 'I must already be attached to the scene graph' ].

self onAddedToSceneGraph.
self eventDispatcher dispatchAddedToSceneGraph.

self childrenDo: [ :anElement |

anElement isAttachedToSceneGraph
Expand Down Expand Up @@ -2748,12 +2750,6 @@ BlElement >> onAddedToSceneGraph [
"Sent after one of my parents or I was added to scene graph, e.g. root element.
At this point #isAttachedToSceneGraph results in true.
Note: Always send onAddedToSceneGraph to super class if you override me!"

self
assert: [ self isAttachedToSceneGraph ]
description: [ 'I must already be attached to the scene graph' ].

self eventDispatcher dispatchAddedToSceneGraph
]

{ #category : #'hooks - children' }
Expand Down

0 comments on commit 0853036

Please sign in to comment.