mirror of
https://github.com/jtdaugherty/brick.git
synced 2024-12-12 12:23:21 +03:00
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:
parent
5314a68477
commit
8e1d7f4810
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user