File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,19 +38,25 @@ BlElementBoundsUpdater >> commitChanges [
3838 thenCollect: [ :eachAssociation | eachAssociation key ].
3939 theElements ifEmpty: [ ^ self ].
4040
41- " <---"
42- self flag: ' Workarroud: avoiding #extractRoots: use speed-up position updates a lot' .
43- " theElements do: [ :eachRootElement |
44- eachRootElement withAllChildrenBreadthFirstDo: [ :eachChild | eachChild onPositionInSpaceChanged ] ]."
45- " --->"
46- self flag: ' Original version' .
47- " <---"
48- self flag: ' It sounds better with #extractRoots: from feenk ' .
49- theRoots := BlSpace extractRoots: theElements.
41+ theRoots := self extractRoots: theElements.
5042 theRoots do: [ :eachRootElement |
5143 eachRootElement withAllChildrenBreadthFirstDo: [ :eachChild | eachChild onPositionInSpaceChanged ] ]
52- " ---> "
44+ ]
5345
46+ { #category : #' private - changes' }
47+ BlElementBoundsUpdater >> extractRoots: aSetOfElements [
48+ | roots |
49+ roots := IdentitySet withAll: aSetOfElements.
50+ aSetOfElements do: [ :each |
51+ | current |
52+ current := each parent.
53+ [ current isNil ] whileFalse: [
54+ (roots includes: current)
55+ ifTrue: [
56+ roots remove: each ifAbsent: [ ].
57+ current := nil ]
58+ ifFalse: [ current := current parent ] ] ].
59+ ^ roots
5460]
5561
5662{ #category : #testing }
Original file line number Diff line number Diff line change @@ -36,7 +36,6 @@ Class {
3636 ' focusChain' ,
3737 ' pulseRequested' ,
3838 ' currentCursor' ,
39- ' session' ,
4039 ' focused' ,
4140 ' title' ,
4241 ' fullscreen' ,
@@ -64,23 +63,11 @@ BlSpace class >> defaultRootLabel [
6463
6564{ #category : #' private - change' }
6665BlSpace class >> extractRoots: aSetOfElements [
67- | roots |
68- " feenk version 2022-02-01 that eliminate recursion from allParentsDo: "
69-
70- roots := IdentitySet withAll: aSetOfElements.
71- aSetOfElements
72- do:
73- [ :each |
74- | current |
75- current := each parent.
76- [ current isNil ]
77- whileFalse:
78- [ (roots includes: current)
79- ifTrue:
80- [ roots remove: each ifAbsent: [ ].
81- current := nil ]
82- ifFalse: [ current := current parent ] ] ].
83- ^ roots
66+ self
67+ deprecated: ' Use BlElementBoundsUpdater >> #extractRoots: instead'
68+ transformWith: ' `@receiver extractRoots: `@arg' - > ' BlElementBoundsUpdater new extractRoots: `@arg' .
69+
70+ ^ BlElementBoundsUpdater new extractRoots: aSetOfElements
8471]
8572
8673{ #category : #' debug - simulation' }
@@ -897,6 +884,10 @@ BlSpace >> extent: aNewExtent [
897884
898885{ #category : #' private - change' }
899886BlSpace >> extractRoots: aSetOfElements [
887+ self
888+ deprecated: ' Use BlElementBoundsUpdater >> #extractRoots: instead'
889+ transformWith: ' `@receiver extractRoots: `@arg' - > ' BlElementBoundsUpdater new extractRoots: `@arg' .
890+
900891 ^ self class extractRoots: aSetOfElements
901892]
902893
You can’t perform that action at this time.
0 commit comments