mirror of
https://github.com/rgleichman/glance.git
synced 2024-11-22 23:28:34 +03:00
Toggle _asMovingNode when clicked
This commit is contained in:
parent
6d22e87061
commit
6fe9c112d4
@ -264,13 +264,15 @@ startApp app = do
|
|||||||
(do
|
(do
|
||||||
putStrLn "Left click"
|
putStrLn "Left click"
|
||||||
mousePosition <- getXandY eventButton
|
mousePosition <- getXandY eventButton
|
||||||
-- print (x, y)
|
|
||||||
|
|
||||||
modifyIORef' stateRef
|
modifyIORef' stateRef
|
||||||
(\s@AppState{_asMovingNode, _asElements}
|
(\s@AppState{_asMovingNode, _asElements}
|
||||||
->
|
->
|
||||||
let
|
let
|
||||||
newMovingNode = findElementByPosition _asElements mousePosition
|
-- toggle _asMovingNode when clicked
|
||||||
|
newMovingNode = case _asMovingNode of
|
||||||
|
Nothing -> findElementByPosition _asElements mousePosition
|
||||||
|
Just _ -> Nothing
|
||||||
in
|
in
|
||||||
s{_asMovingNode=newMovingNode}
|
s{_asMovingNode=newMovingNode}
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user