cached: do not cache visibility requests

This fixes a bug where a cached image can cause a containing viewport to
honor a visibility request when the cached image is re-used. This is
almost certainly never desirable because we probably only want viewports
to scroll visible regions into view the first time they are drawn. This
change makes that so, since the Result returned by 'cached' contains the
visibility requests but its cached representation has them cleared.
This commit is contained in:
Jonathan Daugherty 2022-01-21 10:19:35 -08:00
parent 0b21099b94
commit 590af4dce0

View File

@ -1070,7 +1070,7 @@ cached n w =
Nothing -> do
wResult <- render w
clickables <- renderedClickables wResult
cacheUpdate n (clickables, wResult)
cacheUpdate n (clickables, wResult & visibilityRequestsL .~ mempty)
return wResult
where
-- Given the rendered result of a Widget, collect the list of "clickable" names