Allow detecting the mouse in the gaps between tiles

This commit is contained in:
Emi Simpson 2023-07-04 17:55:05 -04:00
parent 5c9a98df73
commit 17cc6ffb7f
Signed by: Emi
GPG Key ID: A12F2C2FFDC3D847
2 changed files with 10 additions and 1 deletions

View File

@ -175,13 +175,13 @@ viewTile isTileHeld columnIndex tileIndex tile =
(D.field "layerX" D.int)
(D.field "layerY" D.int)
)
, attributeIf isTileHeld (onMouseEnter <| HeldOverNewTile columnIndex tileIndex)
]
[ input
[ value tile.text
, onInput (SetTileText columnIndex tileIndex)
, onBlur (TileDeselected columnIndex)
, attributeIf (isBlank tile.text) (id "new-tile")
, attributeIf isTileHeld (onMouseEnter <| HeldOverNewTile columnIndex tileIndex)
]
[]
, svg

View File

@ -57,6 +57,14 @@ input
margin-bottom: 15px
border: none
&::after
width: 400px
height: 20px
content: ''
position: absolute
top: -20px
z-index: -1 // Prevent fluttering when moving mouse up
input
padding: 20px
margin: 0
@ -77,6 +85,7 @@ input
pointer-events: none // Allow clicking the input box below this
&.add-tile
padding: 0
text-align: center
font-weight: bold
font-size: 80px