From 6997e13011880ecc5fd2363bb63ec898c6105b6a Mon Sep 17 00:00:00 2001 From: Aleksander Morgensterns Date: Sun, 23 Jun 2024 22:56:51 +0200 Subject: [PATCH 1/4] fixed layer sidebar --- source/GM-TE/GMTEEditor.class.st | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/GM-TE/GMTEEditor.class.st b/source/GM-TE/GMTEEditor.class.st index e12b9b6f..09105bb1 100644 --- a/source/GM-TE/GMTEEditor.class.st +++ b/source/GM-TE/GMTEEditor.class.st @@ -430,7 +430,7 @@ GMTEEditor >> createInspectorSpecWithBuilder: aBuilder [ { #category : #building, - #'squeak_changestamp' : 'jj 6/22/2024 20:44' + #'squeak_changestamp' : 'Alex M 6/23/2024 22:56' } GMTEEditor >> createLayersSpecWithBuilder: aBuilder [ "creates the spec for layer viewer" @@ -450,7 +450,7 @@ GMTEEditor >> createLayersSpecWithBuilder: aBuilder [ frame: (LayoutFrame fractions: (0 @ 0 corner: 1 @ 0) offsets: (0 @ 0 corner: 0 @ 30)). (aBuilder pluggablePanelSpec new) - frame: (LayoutFrame fractions: (1 @ 0 corner: 1 @ 1) offsets: (-30 @ 30 corner: 0 @ 0)); + frame: (LayoutFrame fractions: (0.85 @ 0 corner: 1 @ 1) offsets: (0 @ 30 corner: 0 @ 0)); children: { (aBuilder pluggableImageButtonSpec new) @@ -509,7 +509,7 @@ GMTEEditor >> createLayersSpecWithBuilder: aBuilder [ getSelectionList: #layerAt:; setSelectionList: #layerAt:put:; autoDeselect: false; - frame: (LayoutFrame fractions: (0 @ 0 corner: 1 @ 1) offsets: (0 @ 30 corner: -30 @ 0))}; + frame: (LayoutFrame fractions: (0 @ 0 corner: 0.85 @ 1) offsets: (0 @ 30 corner: 0 @ 0))}; verticalResizing: #shrinkWrap; yourself ] From 27395af3fcd9e53b9256b535e4eb4930731a4e58 Mon Sep 17 00:00:00 2001 From: Jannis Jost Date: Mon, 24 Jun 2024 10:58:52 +0200 Subject: [PATCH 2/4] ref --- source/GM-TE/GMTETileMap.class.st | 8 ++++---- source/GM-TE/GMTETileVisual.class.st | 19 +++++++++++-------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/source/GM-TE/GMTETileMap.class.st b/source/GM-TE/GMTETileMap.class.st index 62bea544..12cdbddc 100644 --- a/source/GM-TE/GMTETileMap.class.st +++ b/source/GM-TE/GMTETileMap.class.st @@ -276,13 +276,13 @@ GMTETileMap >> extent: aPoint [ { #category : #'dev-api', - #'squeak_changestamp' : 'Ivo Zilkenat 6/19/2024 22:25' + #'squeak_changestamp' : 'jj 6/24/2024 10:56' } GMTETileMap >> fitBackgroundToMap [ self mapPadding: 0.0. self forceMapSizeRatio: true. - self extent: (self mapSizeWidth)@(self mapSizeHeight). + self extent: (self mapSizeWidth) @ (self mapSizeHeight). self changed ] @@ -342,14 +342,14 @@ GMTETileMap >> fullGridSizeWidth: anObject [ { #category : #initialization, - #'squeak_changestamp' : 'jj 6/22/2024 16:13' + #'squeak_changestamp' : 'jj 6/24/2024 10:58' } GMTETileMap >> generateBackgroundTiles [ self backgroundTiles ifNil: [^ nil]. self tileMatrixStackBackground doTilesXYLidx: [ :x :y :l | - "It is assumed that the visual stack consists of only one layer" + "It is assumed that the background stack consists of only one layer" self generateTileAtlayer: l x: x y: y stack: self tileMatrixStackBackground tileType: GMTETile posCorrectionBlock: [ :aPoint | self correctedTilePositionBackground: aPoint]]. diff --git a/source/GM-TE/GMTETileVisual.class.st b/source/GM-TE/GMTETileVisual.class.st index 2f62b046..ac8d5462 100644 --- a/source/GM-TE/GMTETileVisual.class.st +++ b/source/GM-TE/GMTETileVisual.class.st @@ -30,22 +30,25 @@ GMTETileVisual >> applyBorderHighlighting [ { #category : #highlighting, - #'squeak_changestamp' : 'jj 6/23/2024 16:32' + #'squeak_changestamp' : 'jj 6/24/2024 10:52' } GMTETileVisual >> applyDecoMorphHighlighting: aForm [ | newDecoMorph | aForm ifNotNil: [ - newDecoMorph := ImageMorph new - bounds: self bounds. - newDecoMorph image: (aForm scaledToSize: self extent)] + newDecoMorph := (ImageMorph new) + bounds: self bounds; + image: (aForm scaledToSize: self extent); + yourself] ifNil: [ newDecoMorph := Morph new - bounds: self bounds. - newDecoMorph color: (Color black alpha: GMTETileVisual decoMorphAlphaValue)]. - self addMorph: newDecoMorph. - self decorationMorph: newDecoMorph + bounds: self bounds; + color: (Color black alpha: GMTETileVisual decoMorphAlphaValue); + yourself]. + self + addMorph: newDecoMorph; + decorationMorph: newDecoMorph ] { From 4903f3861fcfcce84e594cfbb1db0666340923c9 Mon Sep 17 00:00:00 2001 From: Jannis Jost Date: Mon, 24 Jun 2024 11:28:32 +0200 Subject: [PATCH 3/4] mainly cascading --- source/GM-TE/GMTEImageMorph.class.st | 7 ++- source/GM-TE/GMTETileMap.class.st | 66 ++++++++++++---------- source/GM-TE/GMTETileMatrixLayer.class.st | 4 +- source/GM-TE/GMTETileSelectionSet.class.st | 5 +- 4 files changed, 45 insertions(+), 37 deletions(-) diff --git a/source/GM-TE/GMTEImageMorph.class.st b/source/GM-TE/GMTEImageMorph.class.st index b8ac3833..af3fd5c0 100644 --- a/source/GM-TE/GMTEImageMorph.class.st +++ b/source/GM-TE/GMTEImageMorph.class.st @@ -104,10 +104,11 @@ GMTEImageMorph >> setPlaceholderWithExtent: anExtent color: aColor [ { #category : #updating, - #'squeak_changestamp' : 'TW 5/22/2024 17:18' + #'squeak_changestamp' : 'jj 6/24/2024 11:19' } GMTEImageMorph >> updateSprite: anImage [ - self fullResolutionSprite: anImage. - self extent: self extent + self + fullResolutionSprite: anImage; + extent: self extent ] diff --git a/source/GM-TE/GMTETileMap.class.st b/source/GM-TE/GMTETileMap.class.st index 57800880..66da5adf 100644 --- a/source/GM-TE/GMTETileMap.class.st +++ b/source/GM-TE/GMTETileMap.class.st @@ -113,12 +113,13 @@ GMTETileMap >> backgroundTiles [ { #category : #accessing, - #'squeak_changestamp' : 'Ivo Zilkenat 6/22/2024 01:21' + #'squeak_changestamp' : 'jj 6/24/2024 11:10' } GMTETileMap >> backgroundTiles: anObject [ - self basicBackgroundTiles: anObject. - self updateMap + self + basicBackgroundTiles: anObject; + updateMap ] @@ -276,14 +277,15 @@ GMTETileMap >> extent: aPoint [ { #category : #'dev-api', - #'squeak_changestamp' : 'jj 6/24/2024 10:56' + #'squeak_changestamp' : 'jj 6/24/2024 11:10' } GMTETileMap >> fitBackgroundToMap [ - self mapPadding: 0.0. - self forceMapSizeRatio: true. - self extent: (self mapSizeWidth) @ (self mapSizeHeight). - self changed + self + mapPadding: 0.0; + forceMapSizeRatio: true; + extent: (self mapSizeWidth) @ (self mapSizeHeight); + changed ] { @@ -457,12 +459,13 @@ GMTETileMap >> getTileFromLayer: aLayer x: x y: y stack: aStack [ { #category : #'dev-api', - #'squeak_changestamp' : 'Ivo Zilkenat 6/19/2024 23:11' + #'squeak_changestamp' : 'jj 6/24/2024 11:11' } GMTETileMap >> hideVisualLayer [ - self tileMatrixStackVisual visible: false. - self changed + self + tileMatrixStackVisual visible: false; + changed ] @@ -487,13 +490,14 @@ GMTETileMap >> initialize [ { #category : #'dev-api', - #'squeak_changestamp' : 'Ivo Zilkenat 6/19/2024 22:53' + #'squeak_changestamp' : 'jj 6/24/2024 11:12' } GMTETileMap >> mapGridOnly [ - self fitBackgroundToMap. - self color: Color transparent. - self changed + self + fitBackgroundToMap; + color: Color transparent; + changed ] { @@ -642,7 +646,7 @@ GMTETileMap >> rescaleMapWidth: aWidth height: aHeigth [ { #category : #updating, - #'squeak_changestamp' : 'Ivo Zilkenat 6/8/2024 21:59' + #'squeak_changestamp' : 'jj 6/24/2024 11:05' } GMTETileMap >> rescaleMapWidth: aWidth height: aHeigth padding: aPadding [ "Rescale map & trigger update" @@ -652,25 +656,25 @@ GMTETileMap >> rescaleMapWidth: aWidth height: aHeigth padding: aPadding [ sizeChanged := (aWidth ~= self mapTileWidth) or: [aHeigth ~= self mapTileHeight]. self setDimensionsWidth: aWidth height: aHeigth padding: aPadding. - (sizeChanged) ifTrue: [ - self rescaleMatrixStacks]. + sizeChanged ifTrue: [self rescaleMatrixStacks]. self updateMap ] { #category : #updating, - #'squeak_changestamp' : 'Ivo Zilkenat 6/18/2024 19:01' + #'squeak_changestamp' : 'jj 6/24/2024 11:13' } GMTETileMap >> rescaleMatrixStacks [ - (self tileMatrixStack) ifNotNil: [ + self tileMatrixStack ifNotNil: [ self tileMatrixStack rescaleToWidth: self mapTileWidth height: self mapTileHeight]. "Rescaling returns a copy of the original tiles, which must be added as submorphs again. TODO: move responsibility to Stack?" self tileMatrixStack doTiles: [ :tile | self addMorph: tile]. - (self tileMatrixStackVisual) ifNotNil: [ - self tileMatrixStackVisual rescaleToWidth: self mapTileWidth height: self mapTileHeight. - self tileMatrixStackVisual reset. + self tileMatrixStackVisual ifNotNil: [ + self tileMatrixStackVisual + rescaleToWidth: self mapTileWidth height: self mapTileHeight; + reset. self generateVisualTiles] ] @@ -797,13 +801,13 @@ GMTETileMap >> tileHeight: anObject [ { #category : #conversion, - #'squeak_changestamp' : 'jj 6/22/2024 16:20' + #'squeak_changestamp' : 'jj 6/24/2024 11:06' } GMTETileMap >> tileIdxFromPosition: aPoint [ | uncorrectedPos idx | uncorrectedPos := self revertCorrectedTilePositionMap: aPoint. - idx := (uncorrectedPos x / self tileSizeWidth + 1)@(uncorrectedPos y / self tileSizeHeight + 1). + idx := (uncorrectedPos x / self tileSizeWidth + 1) @ (uncorrectedPos y / self tileSizeHeight + 1). idx := idx floor. ((self tileMatrixStackVisual layer: 1) validIdx: idx) ifFalse: [^ nil]. @@ -1112,7 +1116,7 @@ GMTETileMap >> updateTileMatrixStack: aStack posCorrectionBlock: aBlock [ { #category : #updating, - #'squeak_changestamp' : 'TW 6/22/2024 01:25' + #'squeak_changestamp' : 'jj 6/24/2024 11:08' } GMTETileMap >> updateTiles [ @@ -1122,12 +1126,14 @@ GMTETileMap >> updateTiles [ (self tileMatrixStackBackground visible) ifTrue: [ - self tileMatrixStackBackground rescaleToWidth: self tileWidth height: self tileHeight. - self tileMatrixStackBackground reset. + self tileMatrixStackBackground + rescaleToWidth: self tileWidth height: self tileHeight; + reset. self generateBackgroundTiles. self updateTileMatrixStack: self tileMatrixStackBackground posCorrectionBlock: [ :aPoint | self correctedTilePositionBackground: aPoint]]. - self updateTileMatrixStack: self tileMatrixStack. - self updateTileMatrixStack: self tileMatrixStackVisual + self + updateTileMatrixStack: self tileMatrixStack; + updateTileMatrixStack: self tileMatrixStackVisual ] diff --git a/source/GM-TE/GMTETileMatrixLayer.class.st b/source/GM-TE/GMTETileMatrixLayer.class.st index 67a0a055..613359a2 100644 --- a/source/GM-TE/GMTETileMatrixLayer.class.st +++ b/source/GM-TE/GMTETileMatrixLayer.class.st @@ -94,12 +94,12 @@ GMTETileMatrixLayer >> displayName: anObject [ { #category : #enumerating, - #'squeak_changestamp' : 'jj 6/23/2024 13:56' + #'squeak_changestamp' : 'jj 6/24/2024 11:21' } GMTETileMatrixLayer >> doTiles: aBlock [ "Instance variable must be used here" - (contents) ifNil: [^ nil]. + contents ifNil: [^ nil]. self contents do: [:tile | tile ifNotNil: [aBlock value: tile]] ] diff --git a/source/GM-TE/GMTETileSelectionSet.class.st b/source/GM-TE/GMTETileSelectionSet.class.st index a23dc70a..66882f14 100644 --- a/source/GM-TE/GMTETileSelectionSet.class.st +++ b/source/GM-TE/GMTETileSelectionSet.class.st @@ -19,11 +19,12 @@ GMTETileSelectionSet >> applyHighlightingVisuals: aTile [ { #category : #highlighting, - #'squeak_changestamp' : 'TW 6/22/2024 01:28' + #'squeak_changestamp' : 'jj 6/24/2024 11:23' } GMTETileSelectionSet >> clearAllHighlightings [ - self do: [ :tile | self removeHighlightingVisuals: tile]. + self do: [ :tile | + self removeHighlightingVisuals: tile]. self removeAll ] From 93701a1813024c9edb25158037bc233c7967d463 Mon Sep 17 00:00:00 2001 From: Jannis Jost Date: Mon, 24 Jun 2024 11:37:09 +0200 Subject: [PATCH 4/4] editor ref --- source/GM-TE/GMTEEditor.class.st | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/GM-TE/GMTEEditor.class.st b/source/GM-TE/GMTEEditor.class.st index 1b7cdf9f..c598ae14 100644 --- a/source/GM-TE/GMTEEditor.class.st +++ b/source/GM-TE/GMTEEditor.class.st @@ -1336,15 +1336,15 @@ GMTEEditor >> selectOnlyLayer: anIndex [ { #category : #accessing, - #'squeak_changestamp' : 'jj 6/22/2024 21:40' + #'squeak_changestamp' : 'jj 6/24/2024 11:33' } GMTEEditor >> selectTile: anObject [ "selects a tile from the tile store" "TODO: might be problematic with tray. Maybe give tiles in the store IDs?" (anObject = self selectedTile) - ifTrue:[self unselectTile] - ifFalse:[ + ifTrue: [self unselectTile] + ifFalse: [ self selectedTile: anObject. self tileMap tileSelectionSet highlightImage: anObject fullResolutionSprite. self trayViewer morph submorphs first