Redo more complex selection positions--results in slowdown
This commit is contained in:
+13
-4
@@ -103,10 +103,19 @@ zoneClouds w = w & clZoning %~ \zn ->
|
||||
--runIdentity (S.fold_ (flip $ updateZoning (:)) (zn & znObjects .~ mempty) id (_clouds w))
|
||||
|
||||
updateWorldSelect :: World -> World
|
||||
updateWorldSelect w = case w ^? mouseButtons . ix ButtonLeft of
|
||||
Nothing -> w
|
||||
Just False -> w & wSelect . _1 .~ mouseWorldPos w
|
||||
Just True -> w & wSelect . _2 .~ mouseWorldPos w
|
||||
updateWorldSelect w = f . g $ case (w ^? mouseButtons . ix ButtonLeft, w ^? mouseButtons . ix ButtonRight) of
|
||||
(Nothing ,Nothing) -> w
|
||||
(Just False,Nothing) -> w & lLine . _1 .~ mwp
|
||||
(Just True ,Nothing) -> w & lLine . _2 .~ mwp
|
||||
(Nothing ,_) -> w
|
||||
(Just False,_) -> w & rLine . _1 .~ mwp
|
||||
(Just True ,_) -> w & rLine . _2 .~ mwp
|
||||
where
|
||||
mwp = mouseWorldPos w
|
||||
f | ButtonLeft `M.member` _mouseButtons w = lSelect .~ mwp
|
||||
| otherwise = id
|
||||
g | ButtonRight `M.member` _mouseButtons w = rSelect .~ mwp
|
||||
| otherwise = id
|
||||
|
||||
mcChooseUpdate :: Machine -> Machine -> World -> World
|
||||
mcChooseUpdate mc mc'
|
||||
|
||||
Reference in New Issue
Block a user