about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsternenseemann <git@lukasepple.de>2019-05-30 13:50:52 +0200
committersternenseemann <git@lukasepple.de>2019-05-30 13:50:52 +0200
commit1145b1476aa903ff82aceada97209613346e6088 (patch)
tree4b8a9dad16ee65c15f02711755894ae76d487493
parent0fbb38f8af21869894fd7ec3208957b6879e8b1c (diff)
fix bug leading to not centered viewport
-rw-r--r--lib/Grav2ty/Control.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Grav2ty/Control.hs b/lib/Grav2ty/Control.hs
index 2a620e0..ea90af5 100644
--- a/lib/Grav2ty/Control.hs
+++ b/lib/Grav2ty/Control.hs
@@ -104,7 +104,8 @@ updateState t extract state =
         updateAndExtract acc@(seq, f) x =
           if isDynamic x && (anyU relColl x objectRel == Just True)
              then acc
-             else (updateObject' x >< seq, (.) <$> extract x <*> f)
+             else (updateObject' x >< seq, chainFun (extract x) f)
+        chainFun x f = if isJust f then (.) <$> x <*> f else x
         objectRel = objectRelGraph oldWorld
         scaledT = state^.control^.ctrlTimeScale * t
         updateObject' obj =