Commit 92e82a94 authored by Guerric Chupin's avatar Guerric Chupin

Little correction to tile rotation.

parent 45073a43
......@@ -34,3 +34,5 @@ html/
*.hp
*.prof
*.ps
*.html
*.folded
\ No newline at end of file
......@@ -88,7 +88,7 @@ varFreqSine :: SF DTime Double
varFreqSine = sin ^<< (2*pi*) ^<< (`mod'` 1) ^<< integral <<^ (1/)
repeatedlyS :: a -> SF DTime (Event a)
repeatedlyS x = edgeBy (\a b -> if a * b < 0 then Just x else Nothing) 0
repeatedlyS x = edgeBy (\a b -> maybeIf (a * b > 0) $> x) 0
<<< varFreqSine <<^ (2*)
-- Similar to onChange but contains its initial value in the first
......
......@@ -11,6 +11,7 @@ module RMCA.GUI.Board ( GUICell (..)
, fromGUICoords
, validArea
, Player(..)
, actualTile
) where
import Control.Monad
......
......@@ -60,12 +60,14 @@ createNotebook addLayerRV rmLayerRV layerMCBMVar guiCellMCBMVar = do
let clickHandler ioBoard = do
state <- newEmptyMVar
boardOnPress ioBoard
(\iPos -> liftIO $ do
(\iPos' -> liftIO $ do
let iPos = actualTile iPos'
postGUIAsync $ void $ tryPutMVar state iPos
return True
)
boardOnRelease ioBoard
(\fPos -> do
(\fPos' -> do
let fPos = actualTile fPos'
button <- eventButton
liftIO $ postGUIAsync $ do
mp <- boardGetPiece fPos ioBoard
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment