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