Fix window size bug
This commit is contained in:
parent
c39357a93b
commit
c096923f39
|
@ -44,15 +44,15 @@ processEvent = event noEvent $ \case
|
||||||
EventMotion {} -> noEvent
|
EventMotion {} -> noEvent
|
||||||
EventResize size -> Event $ Resize size
|
EventResize size -> Event $ Resize size
|
||||||
|
|
||||||
run :: forall f. DisplayableSpace f => f Bool -> SF InputEvent Picture
|
run :: DisplayableSpace f => (Int, Int) -> f Bool -> SF InputEvent Picture
|
||||||
run st =
|
run size st =
|
||||||
let initSpace = gol' standardRule st
|
let initSpace = gol' standardRule st
|
||||||
in proc inp -> do
|
in proc inp -> do
|
||||||
let cmdev = processEvent inp
|
let cmdev = processEvent inp
|
||||||
|
|
||||||
playing <- accumHoldBy (const . not) True -< filterE isPlayPause cmdev
|
playing <- accumHoldBy (const . not) True -< filterE isPlayPause cmdev
|
||||||
time <- accum 0.2 -< mapFilterE getChangeSpeed cmdev
|
time <- accum 0.2 -< mapFilterE getChangeSpeed cmdev
|
||||||
windowSize <- hold (100, 100) -< mapFilterE getResize cmdev
|
windowSize <- hold size -< mapFilterE getResize cmdev
|
||||||
|
|
||||||
tick <- tickSignal -< time
|
tick <- tickSignal -< time
|
||||||
space <- engine initSpace -< gate tick playing
|
space <- engine initSpace -< gate tick playing
|
||||||
|
|
Loading…
Reference in a new issue