Skip to content

Commit

Permalink
Merge origin/tmm-dev into tmm-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivo Zilkenat committed Jul 10, 2024
2 parents c24224f + 72b58f7 commit da0cbd8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions source/GM-TE/GMTEBrush.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ GMTEBrush >> radius: anObject [

{
#category : #forms,
#'squeak_changestamp' : 'Valentin Teutschbein 7/9/2024 22:11'
#'squeak_changestamp' : 'Valentin Teutschbein 7/10/2024 12:37'
}
GMTEBrush >> radiusBrush [

Expand All @@ -250,7 +250,7 @@ GMTEBrush >> radiusBrush [

(xMin to: xMax) do: [:x |
(yMin to: yMax) do: [:y |
(( self currentMatrixIndex x - x) squared + ( self currentMatrixIndex y - y) squared <= self radius squared) ifTrue: [
(( self currentMatrixIndex x - x) squared + ( self currentMatrixIndex y - y) squared <= (self radius - 1) squared) ifTrue: [
collection add: x@y
].
].
Expand Down
18 changes: 9 additions & 9 deletions source/GM-TE/GMTEEditorTileMap.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ GMTEEditorTileMap >> model: anObject [

{
#category : #'event handling',
#'squeak_changestamp' : 'Valentin Teutschbein 7/9/2024 21:46'
#'squeak_changestamp' : 'Valentin Teutschbein 7/10/2024 13:07'
}
GMTEEditorTileMap >> mouseDown: anEvent [
"Implements placement of tiles"
Expand All @@ -134,7 +134,7 @@ GMTEEditorTileMap >> mouseDown: anEvent [
selectedIndex := self tileIndexFromPosition: anEvent position.
self model brush firstMatrixIndex: selectedIndex.
selectedCoordinates := self model brush executeWithMatrixIndex: selectedIndex andLayer: (self tileMatrixStack layer: activeLayer).
"self updateTiles: selectedCoordinates inLayer: activeLayer FromEvent: anEvent."
anEvent yellowButtonPressed ifTrue: [self tileSelectionSet highlightImage: nil].

^ true
]
Expand All @@ -150,7 +150,7 @@ GMTEEditorTileMap >> mouseLeave: anEvent [

{
#category : #'event handling',
#'squeak_changestamp' : 'Valentin Teutschbein 7/9/2024 22:02'
#'squeak_changestamp' : 'Valentin Teutschbein 7/10/2024 13:06'
}
GMTEEditorTileMap >> mouseMove: anEvent [
"Implements highlighting of tiles when hovering"
Expand All @@ -163,17 +163,16 @@ GMTEEditorTileMap >> mouseMove: anEvent [
(anEvent redButtonPressed or: [anEvent yellowButtonPressed]) ifFalse: [self model brush resetOutputSet].
self tileSelectionSet clearAllHighlightings.

selectedCoordinates ifNil: [
^ nil].
selectedCoordinates ifNil: [^ nil].

(selectedCoordinates select: [:c | (self tileMatrixStack layer: activeLayer) inBounds: c]) do: [:c|
hoveredTileHighlighting := self highlightingTileFromIndex: c.
(selectedCoordinates select: [:c | (self tileMatrixStack layer: activeLayer) inBounds: c]) do: [:t|
hoveredTileHighlighting := self highlightingTileFromIndex: t.
hoveredTileHighlighting ifNotNil: [self tileSelectionSet highlightTile: hoveredTileHighlighting]].
]

{
#category : #'event handling',
#'squeak_changestamp' : 'Valentin Teutschbein 7/9/2024 22:13'
#'squeak_changestamp' : 'Valentin Teutschbein 7/10/2024 13:11'
}
GMTEEditorTileMap >> mouseUp: anEvent [

Expand All @@ -183,7 +182,8 @@ GMTEEditorTileMap >> mouseUp: anEvent [
activeLayer := self model selectedLayers anyOne.
self updateTiles: (indicesToAdd asCollection) inLayer: activeLayer FromEvent: anEvent.
self model brush resetOutputSet.
(self previousTileStates size > 0) ifTrue: [self saveTileEditChanges]
(self previousTileStates size > 0) ifTrue: [self saveTileEditChanges].
self tileSelectionSet highlightImage: (self model selectedTile).
]

{
Expand Down

0 comments on commit da0cbd8

Please sign in to comment.