Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fixed a bug where selecting a sprite would put it beneath unselected

sprites
  • Loading branch information...
commit d76229b3ed857e02c7e3a257f07fbe8875e9e034 1 parent b7f6245
authored

Showing 1 changed file with 3 additions and 7 deletions. Show diff stats Hide diff stats

  1. +3 7 Bindings.hs
10 Bindings.hs
@@ -16,7 +16,6 @@ keyboardMouse :: Window -> IORef Env -> Key -> KeyState -> Modifiers -> Position
16 16 keyboardMouse _ env key state _ _ = do
17 17 e <- get env
18 18
19   - -- TODO: put these modes in different files, maybe
20 19 let
21 20 dispatchAction = case (mode$vars$e) of
22 21 Animator -> animatorAction
@@ -55,9 +54,6 @@ animatorAction e (MouseButton RightButton) Down =
55 54 mkPath :: [Position]
56 55 mkPath = replicate (animClock$vars$e) (Position 1000 1000) ++ [(mousePos$vars$e)]
57 56
58   ---
59   --- TODO: look at this mess!
60   ---
61 57 animatorAction e (MouseButton LeftButton) Down =
62 58 (handleButtons . handleSprites) e
63 59 where
@@ -67,7 +63,6 @@ animatorAction e (MouseButton LeftButton) Down =
67 63 vars = (vars$env) { menu = updateMenu (menu$vars$env) }
68 64 }
69 65
70   - -- ugh...
71 66 updateMenu :: MmaMenu -> MmaMenu
72 67 updateMenu m
73 68 | Just (playButton m) == thisButton =
@@ -118,8 +113,9 @@ animatorAction e (MouseButton LeftButton) Down =
118 113 }
119 114
120 115 updateSelected :: [Sprite] -> [Sprite]
121   - updateSelected ss = map (\s -> s {selected=True}) (spriteUnder ss) ++
122   - map (\s -> s {selected=False}) (ss \\ (spriteUnder ss))
  116 + updateSelected ss = map (\s -> s {selected=False}) (ss \\ (spriteUnder ss)) ++
  117 + map (\s -> s {selected=True}) (spriteUnder ss)
  118 +
123 119
124 120 updateDragged :: [Sprite] -> [Sprite]
125 121 updateDragged ss = map (initDragSprite mp) (spriteUnder ss) ++

0 comments on commit d76229b

Please sign in to comment.
Something went wrong with that request. Please try again.