@@ -374,11 +374,11 @@ GMTEEditor >> associatedMorph [
374374
375375{
376376 #category : #accessing ,
377- #' squeak_changestamp' : ' TW 6/25 /2024 15:55 '
377+ #' squeak_changestamp' : ' mcjj 7/12 /2024 19:38 '
378378}
379379GMTEEditor >> associatedMorph: anObject [
380380
381- associatedMorph := anObject.
381+ associatedMorph := anObject
382382]
383383
384384{
@@ -450,11 +450,11 @@ GMTEEditor >> brushButtons [
450450
451451{
452452 #category : #accessing ,
453- #' squeak_changestamp' : ' TW 7/9 /2024 18:19 '
453+ #' squeak_changestamp' : ' mcjj 7/12 /2024 19:38 '
454454}
455455GMTEEditor >> brushButtons: anObject [
456456
457- brushButtons := anObject.
457+ brushButtons := anObject
458458]
459459
460460{
@@ -1065,12 +1065,15 @@ GMTEEditor >> exportAsImage [
10651065
10661066{
10671067 #category : #' menu button functions' ,
1068- #' squeak_changestamp' : ' jj 6/23 /2024 14:14 '
1068+ #' squeak_changestamp' : ' Ivo Zilkenat 7/12 /2024 19:18 '
10691069}
10701070GMTEEditor >> exportAsMorph [
10711071 " saves the current tileMap as a .morph file, which allows for reimporting"
10721072
1073- (self tileMap copy model: nil ) saveOnFile.
1073+ ((self tileMap veryDeepCopy)
1074+ model: nil ;
1075+ resetView
1076+ ) saveOnFile.
10741077 self savedSinceModified: true
10751078]
10761079
@@ -1101,11 +1104,12 @@ GMTEEditor >> exportMenu [
11011104
11021105{
11031106 #category : #' input handling' ,
1104- #' squeak_changestamp' : ' mcjj 7/12/2024 17:12 '
1107+ #' squeak_changestamp' : ' mcjj 7/12/2024 19:34 '
11051108}
11061109GMTEEditor >> filterEvent: aKeyboardEvent for: anObject [
1107- | key |
1110+ " handles keyboard shortcuts "
11081111
1112+ | key |
11091113 aKeyboardEvent isKeystroke
11101114 ifFalse: [^ aKeyboardEvent].
11111115
@@ -1118,7 +1122,6 @@ GMTEEditor >> filterEvent: aKeyboardEvent for: anObject [
11181122 [$o] - > [self importFromTileset].
11191123 [$g] - > [self toggleGrid].
11201124 [$h] - > [self toggleBackgroundTiles].
1121- [$r] - > [self rotateSelectedTile].
11221125
11231126 [$a] - > [self addLayer].
11241127 [$n] - > [self renameLayer].
@@ -1129,6 +1132,7 @@ GMTEEditor >> filterEvent: aKeyboardEvent for: anObject [
11291132
11301133 [$z] - > [self undo].
11311134 [$y] - > [self redo].
1135+ [$r] - > [self rotateSelectedTile].
11321136 [$1 ] - > [self selectRadiusBrush].
11331137 [$2 ] - > [self selectLineBrush].
11341138 [$3 ] - > [self selectFillBrush].
@@ -1800,6 +1804,16 @@ GMTEEditor >> renameLayer [
18001804
18011805]
18021806
1807+ {
1808+ #category : #tilemap ,
1809+ #' squeak_changestamp' : ' Alex M 7/12/2024 19:51'
1810+ }
1811+ GMTEEditor >> rescaleGridDimensions: aPoint [
1812+
1813+ (self getGridWidth = aPoint x) ifFalse: [self rescaleGridWidth: aPoint x].
1814+ (self getGridHeight = aPoint y) ifFalse: [self rescaleGridHeight: aPoint y].
1815+ ]
1816+
18031817{
18041818 #category : #tilemap ,
18051819 #' squeak_changestamp' : ' Alex M 7/1/2024 21:04'
@@ -2072,38 +2086,37 @@ GMTEEditor >> setBrushRadiusFromText: aText [
20722086
20732087{
20742088 #category : #tilemap ,
2075- #' squeak_changestamp' : ' Alex M 7/1 /2024 21:06 '
2089+ #' squeak_changestamp' : ' Alex M 7/12 /2024 20:03 '
20762090}
20772091GMTEEditor >> setGridHeight: aText [
20782092 " adjusts the grid height"
20792093
2080- | oldHeight newHeight |
2081- oldHeight := self getGridHeight.
2094+ | oldSize newHeight |
2095+ oldSize := self getGridWidth @ self getGridHeight.
20822096 newHeight := self parseGridSize: aText.
20832097 newHeight ifNotNil: [
20842098 self
2085- rescaleGridHeight: newHeight;
2086- addCommand: ( GMTETilemapSizeCommand prevValue: oldHeight newValue: newHeight method: # rescaleGridHeight: editor: self ) ].
2099+ addCommand: ( GMTETilemapSizeCommand prevSize: oldSize newSize: oldSize x @ newHeight editor: self ) ;
2100+ rescaleGridHeight: newHeight ].
20872101 ^ true
20882102
20892103
20902104]
20912105
20922106{
20932107 #category : #tilemap ,
2094- #' squeak_changestamp' : ' Alex M 7/1 /2024 21 :06'
2108+ #' squeak_changestamp' : ' Alex M 7/12 /2024 20 :06'
20952109}
20962110GMTEEditor >> setGridWidth: aText [
20972111 " adjusts the grid width"
2098- " TODO: Fix visual layer bug"
20992112
2100- | oldWidth newWidth |
2101- oldWidth := self getGridWidth.
2113+ | oldSize newWidth |
2114+ oldSize := self getGridWidth @ self getGridHeight .
21022115 newWidth := self parseGridSize: aText.
2103- oldWidth ifNotNil: [
2116+ newWidth ifNotNil: [
21042117 self
2105- rescaleGridWidth: newWidth;
2106- addCommand: ( GMTETilemapSizeCommand prevValue: oldWidth newValue: newWidth method: # rescaleGridWidth: editor: self ) ].
2118+ addCommand: ( GMTETilemapSizeCommand prevSize: oldSize newSize: newWidth @ oldSize y editor: self ) ;
2119+ rescaleGridWidth: newWidth ].
21072120 ^ true
21082121
21092122]
@@ -2298,7 +2311,7 @@ GMTEEditor >> trayViewer: anObject [
22982311
22992312{
23002313 #category : #' command processing' ,
2301- #' squeak_changestamp' : ' Alex M 7/10 /2024 14:17 '
2314+ #' squeak_changestamp' : ' Alex M 7/12 /2024 19:52 '
23022315}
23032316GMTEEditor >> undo [
23042317
@@ -2307,10 +2320,8 @@ GMTEEditor >> undo [
23072320 ifTrue: [(self commands at: self currentCommand) undo.
23082321 self
23092322 savedSinceModified: false ;
2310- currentCommand: self currentCommand - 1 .
2311- ({GMTETilemapSizeCommand . GMTEDeleteLayersCommand } includes: (self commands at: self currentCommand + 1 ) class )
2312- ifTrue: [self redoAllCommandsUntil: self currentCommand].
2313- self savedSinceModified: false ]
2323+ currentCommand: self currentCommand - 1 ;
2324+ savedSinceModified: false ]
23142325]
23152326
23162327{
0 commit comments