Skip to content

Commit

Permalink
Fixed layer visibilty bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivo Zilkenat committed Jun 23, 2024
1 parent bf2ace9 commit 3d881f7
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 9 deletions.
21 changes: 17 additions & 4 deletions source/GM-TE/GMTETileMatrixLayer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ Class {

{
#category : #'as yet unclassified',
#'squeak_changestamp' : 'jj 6/22/2024 16:27'
#'squeak_changestamp' : 'Ivo Zilkenat 6/23/2024 21:11'
}
GMTETileMatrixLayer class >> width: aWidth height: aHeight layerIdx: anIdx [

^ (self rows: aHeight columns: aWidth)
layerIdx: anIdx;
displayName: 'Layer ', anIdx;
yourself
]

Expand All @@ -32,7 +33,7 @@ GMTETileMatrixLayer >> aboveLayer: aLayer [

{
#category : #adding,
#'squeak_changestamp' : 'TW 6/23/2024 20:38'
#'squeak_changestamp' : 'Ivo Zilkenat 6/23/2024 21:27'
}
GMTETileMatrixLayer >> addTile: aTile at: y at: x [

Expand Down Expand Up @@ -111,6 +112,18 @@ GMTETileMatrixLayer >> free [
self setNil
]

{
#category : #initialization,
#'squeak_changestamp' : 'Ivo Zilkenat 6/23/2024 21:09'
}
GMTETileMatrixLayer >> initialize [

super initialize.
self visible: true


]

{
#category : #accessing,
#'squeak_changestamp' : 'jj 6/22/2024 16:24'
Expand Down Expand Up @@ -141,9 +154,9 @@ GMTETileMatrixLayer >> setNil [

{
#category : #updating,
#'squeak_changestamp' : 'jj 6/22/2024 16:25'
#'squeak_changestamp' : 'Ivo Zilkenat 6/23/2024 21:22'
}
GMTETileMatrixLayer >> updateLayerIdx: anIdx [
GMTETileMatrixLayer >> updateLayerTo: anIdx [

self layerIdx: anIdx.
self doTiles: [:tile | tile morphicLayerNumber: self layerIdx]
Expand Down
21 changes: 16 additions & 5 deletions source/GM-TE/GMTETileMatrixStack.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ GMTETileMatrixStack >> blendLayers: aSet [
self blendLayer: anIdx1 with: anIdx2]
]

{
#category : #eumerating,
#'squeak_changestamp' : 'Ivo Zilkenat 6/23/2024 21:30'
}
GMTETileMatrixStack >> collectLayers: aBlock [

^ self matrixLayers collect: [:layer | aBlock value: layer]
]

{
#category : #eumerating,
#'squeak_changestamp' : 'Ivo Zilkenat 6/23/2024 19:53'
Expand Down Expand Up @@ -305,14 +314,16 @@ GMTETileMatrixStack >> morphicLayerStartingOffset: anObject [

{
#category : #adding,
#'squeak_changestamp' : 'jj 6/23/2024 18:02'
#'squeak_changestamp' : 'Ivo Zilkenat 6/23/2024 21:26'
}
GMTETileMatrixStack >> pushLayer [

self matrixLayers addLast: (GMTETileMatrixLayer
width: self width
height: self height
layerIdx: (self morphicLayerStartingOffset - self layerCount - GMTETileMatrixStack morphicLayerDistance))
layerIdx: (self morphicLayerStartingOffset - self layerCount - GMTETileMatrixStack morphicLayerDistance)).

self matrixLayers last displayName: 'Layer ', self layerCount
]

{
Expand Down Expand Up @@ -454,7 +465,7 @@ GMTETileMatrixStack >> sortLayerSet: aSet [

{
#category : #updating,
#'squeak_changestamp' : 'jj 6/22/2024 16:30'
#'squeak_changestamp' : 'Ivo Zilkenat 6/23/2024 21:22'
}
GMTETileMatrixStack >> swapLayer: anIdx1 with: anIdx2 [

Expand All @@ -463,8 +474,8 @@ GMTETileMatrixStack >> swapLayer: anIdx1 with: anIdx2 [
layer2 := self layer: anIdx2.
tmpMorhpicLayer := layer1 layerIdx.

layer1 updateLayerIdx: layer2 layerIdx.
layer2 updateLayerIdx: tmpMorhpicLayer.
layer1 updateLayerTo: layer2 layerIdx.
layer2 updateLayerTo: tmpMorhpicLayer.

self matrixLayers swap: anIdx1 with: anIdx2

Expand Down

0 comments on commit 3d881f7

Please sign in to comment.