@@ -270,7 +270,7 @@ GMTETileMap >> correctedTilePositionMap: aPoint [
270
270
271
271
{
272
272
#category : #updating ,
273
- #' squeak_changestamp' : ' Valentin Teutschbein 7/12/2024 18:32 '
273
+ #' squeak_changestamp' : ' Ivo Zilkenat 7/12/2024 20:58 '
274
274
}
275
275
GMTETileMap >> deleteTiles: anIndexSet inLayer: aLayer [
276
276
" delete tiles from editable matrix stack at given indices"
@@ -297,11 +297,10 @@ GMTETileMap >> dimensionsSet [
297
297
298
298
{
299
299
#category : #' import/export' ,
300
- #' squeak_changestamp' : ' Ivo Zilkenat 6/24 /2024 11:21 '
300
+ #' squeak_changestamp' : ' Ivo Zilkenat 7/12 /2024 20:52 '
301
301
}
302
302
GMTETileMap >> exportAsImage [
303
- " TODO:Add further options in the future like choosing file format?"
304
-
303
+
305
304
self exportAsPNG
306
305
]
307
306
@@ -431,15 +430,25 @@ GMTETileMap >> generateHighlightingTiles [
431
430
432
431
{
433
432
#category : #initialization ,
434
- #' squeak_changestamp' : ' Ivo Zilkenat 6/24 /2024 11:22 '
433
+ #' squeak_changestamp' : ' Ivo Zilkenat 7/12 /2024 20:54 '
435
434
}
436
435
GMTETileMap >> generateMatrixStacks [
437
436
" Generate the 3 matrix stacks (editable, highlighting, background)"
438
437
439
- self tileMatrixStackBackground: (GMTETileMatrixStack fromWidth: self tileWidth height: self tileHeight morphicLayerOffset: GMTETileMatrixStack morphicLayerOffsetDefault + 1 ).
440
- self tileMatrixStack: (GMTETileMatrixStack fromWidth: self mapTileWidth height: self mapTileHeight morphicLayerOffset: GMTETileMatrixStack morphicLayerOffsetDefault).
441
- self tileMatrixStackHighlighting: (GMTETileMatrixStack fromWidth: self mapTileWidth height: self mapTileHeight morphicLayerOffset: GMTETileMatrixStack morphicLayerOffsetDefault - GMTETileMap maxLayers - GMTETileMatrixStack morphicLayerDistance). " ensures that the visual layer is always is front of every other layer"
442
- " self generateBackgroundTiles."
438
+ " Ensures that the background layer is always behind every other layer"
439
+ self tileMatrixStackBackground: (GMTETileMatrixStack
440
+ fromWidth: self tileWidth
441
+ height: self tileHeight
442
+ morphicLayerOffset: (GMTETileMatrixStack morphicLayerOffsetDefault + 1 )).
443
+ self tileMatrixStack: (GMTETileMatrixStack
444
+ fromWidth: self mapTileWidth
445
+ height: self mapTileHeight
446
+ morphicLayerOffset: GMTETileMatrixStack morphicLayerOffsetDefault).
447
+ " Ensures that the visual layer is always is front of every other layer"
448
+ self tileMatrixStackHighlighting: (GMTETileMatrixStack
449
+ fromWidth: self mapTileWidth
450
+ height: self mapTileHeight
451
+ morphicLayerOffset: (GMTETileMatrixStack morphicLayerOffsetDefault - GMTETileMap maxLayers - GMTETileMatrixStack morphicLayerDistance)).
443
452
self generateHighlightingTiles.
444
453
self toggleBackgroundLayer
445
454
]
@@ -613,7 +622,7 @@ GMTETileMap >> inViewPointToViewFraction: aPoint [
613
622
614
623
{
615
624
#category : #initialization ,
616
- #' squeak_changestamp' : ' Ivo Zilkenat 7/12/2024 17:04 '
625
+ #' squeak_changestamp' : ' Ivo Zilkenat 7/12/2024 20:55 '
617
626
}
618
627
GMTETileMap >> initialize [
619
628
@@ -624,10 +633,7 @@ GMTETileMap >> initialize [
624
633
forceMapSizeRatio: false ;
625
634
view: GMTEView new ;
626
635
hasStaticView: true ;
627
-
628
- " TODO: spike solution. Size 1@1 sets quadratic base image. Generic resizing not working yet"
629
- " TODO: default background tiles (must not exist but practical as a visual indicator)"
630
- backgroundTiles: GMTETile checkerBoardTile
636
+ backgroundTiles: GMTETile checkerBoardTile
631
637
632
638
]
633
639
@@ -785,12 +791,9 @@ GMTETileMap >> mouseMove: anEvent [
785
791
786
792
{
787
793
#category : #' event handling' ,
788
- #' squeak_changestamp' : ' Ivo Zilkenat 7/12/2024 17:57 '
794
+ #' squeak_changestamp' : ' Ivo Zilkenat 7/12/2024 20:51 '
789
795
}
790
796
GMTETileMap >> mouseWheel: anEvent [
791
-
792
- self flag: ' does not work' .
793
- " anEvent shiftPressed ifFalse: [^ nil]."
794
797
795
798
self hasStaticView ifTrue: [^ nil ].
796
799
anEvent isWheelDown ifTrue: [self zoomOutAt: (anEvent position - self topLeft)].
@@ -811,7 +814,7 @@ GMTETileMap >> moveViewBy: aPoint [
811
814
812
815
{
813
816
#category : #updating ,
814
- #' squeak_changestamp' : ' Valentin Teutschbein 7/12/2024 19:22 '
817
+ #' squeak_changestamp' : ' Ivo Zilkenat 7/12/2024 20:58 '
815
818
}
816
819
GMTETileMap >> placeTiles: anIndexSet inLayer: aLayer ofClass: aTileClass withImage: anImage [
817
820
@@ -872,14 +875,13 @@ GMTETileMap >> rescaleMapWidth: aWidth height: aHeigth padding: aPadding [
872
875
873
876
{
874
877
#category : #updating ,
875
- #' squeak_changestamp' : ' Ivo Zilkenat 6/24 /2024 11:55 '
878
+ #' squeak_changestamp' : ' Ivo Zilkenat 7/12 /2024 20:56 '
876
879
}
877
880
GMTETileMap >> rescaleMatrixStacks [
878
881
" Rescale matrix stacks to apply new dimensions"
879
882
880
883
self tileMatrixStack ifNotNil: [
881
884
self tileMatrixStack rescaleToWidth: self mapTileWidth height: self mapTileHeight].
882
- " Rescaling returns a copy of the original tiles, which must be added as submorphs again. TODO: move responsibility to Stack?"
883
885
self tileMatrixStack doTiles: [:tile |
884
886
self addMorph: tile].
885
887
self tileMatrixStackHighlighting ifNotNil: [
@@ -964,14 +966,13 @@ GMTETileMap >> setDimensionsWidth: aWidth height: aHeigth padding: aPadding [
964
966
965
967
{
966
968
#category : #' dev-api' ,
967
- #' squeak_changestamp' : ' Ivo Zilkenat 6/24 /2024 11:19 '
969
+ #' squeak_changestamp' : ' Ivo Zilkenat 7/12 /2024 20:51 '
968
970
}
969
971
GMTETileMap >> showHighlightingLayer [
970
972
" Shows / hides the grid"
971
973
972
974
self tileMatrixStackHighlighting visible: true .
973
975
self changed
974
- " self rescaleMap."
975
976
]
976
977
977
978
{
@@ -1331,7 +1332,7 @@ GMTETileMap >> updateTileMatrixStack: aStack [
1331
1332
1332
1333
{
1333
1334
#category : #updating ,
1334
- #' squeak_changestamp' : ' Ivo Zilkenat 7/2 /2024 20:41 '
1335
+ #' squeak_changestamp' : ' Ivo Zilkenat 7/12 /2024 20:58 '
1335
1336
}
1336
1337
GMTETileMap >> updateTileMatrixStack: aStack posCorrectionBlock: aBlock [
1337
1338
" Update matrix stacks by applying new dimensions & positions"
@@ -1351,14 +1352,11 @@ GMTETileMap >> updateTileMatrixStack: aStack posCorrectionBlock: aBlock [
1351
1352
1352
1353
{
1353
1354
#category : #updating ,
1354
- #' squeak_changestamp' : ' Ivo Zilkenat 7/2 /2024 17:54 '
1355
+ #' squeak_changestamp' : ' Ivo Zilkenat 7/12 /2024 20:57 '
1355
1356
}
1356
1357
GMTETileMap >> updateTiles [
1357
1358
" Collectively update all matrix stacks and therefore all tiles contained within"
1358
-
1359
- " Background also has to rescale"
1360
- " TODO: This should be refactored"
1361
- " TODO: Rescaling is not very performant"
1359
+ " Note: Rescaling is not very performant"
1362
1360
1363
1361
self
1364
1362
updateTilesBackground;
0 commit comments