Internal: force-evaluate the new render state.

Widgets might retain computations which are not actually needed to render
the image (e. g., the text widget might contain more lines than can be shown
on screen). This seems to leak space as it is left unclear that computations
needed to render the current frame will not be needed anymore after the
image is shown.
This commit is contained in:
Sebastian Reuße 2015-08-24 13:51:47 +02:00
parent 5314a68477
commit 8e1d7f4810

View File

@ -1,3 +1,5 @@
{-# LANGUAGE BangPatterns #-}
module Brick.Widgets.Internal
( renderFinal
, cropToContext
@ -24,7 +26,7 @@ renderFinal :: AttrMap
-> (RenderState, V.Picture, Maybe CursorLocation)
renderFinal aMap layerRenders sz chooseCursor rs = (newRS, pic, theCursor)
where
(layerResults, newRS) = flip runState rs $ sequence $
(layerResults, !newRS) = flip runState rs $ sequence $
(\p -> runReaderT p ctx) <$>
(render <$> cropToContext <$> layerRenders)
ctx = Context def (fst sz) (snd sz) def aMap