From 5909eec23151711718207c5cb6cd192b82aaa5ae Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Thu, 7 Jan 2021 00:15:54 -0500 Subject: [PATCH 1/2] be careful about rewriting empty images --- src/Brick/Widgets/Core.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Brick/Widgets/Core.hs b/src/Brick/Widgets/Core.hs index bbc980f..4126f34 100644 --- a/src/Brick/Widgets/Core.hs +++ b/src/Brick/Widgets/Core.hs @@ -753,13 +753,13 @@ rewriteImage br (loRewrite, hiRewrite) old = rewriteHi . rewriteLo $ old where size = imagePrimary br old go = rewriteEdge (splitLoSecondary br) (splitHiSecondary br) (concatenateSecondary br) rewriteLo img - | I.null loRewrite = img + | I.null loRewrite || size == 0 = img | otherwise = concatenatePrimary br [ go loRewrite (splitLoPrimary br 1 img) , splitHiPrimary br 1 img ] rewriteHi img - | I.null hiRewrite = img + | I.null hiRewrite || size == 0 = img | otherwise = concatenatePrimary br [ splitLoPrimary br (size-1) img , go hiRewrite (splitHiPrimary br (size-1) img) From 145500529b358b6312fc217f38418ba31025f1d2 Mon Sep 17 00:00:00 2001 From: Doug Burke Date: Sat, 9 Jan 2021 10:41:14 -0500 Subject: [PATCH 2/2] Docfix: update location of hCenter --- docs/guide.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide.rst b/docs/guide.rst index e508097..2819c7f 100644 --- a/docs/guide.rst +++ b/docs/guide.rst @@ -620,7 +620,7 @@ A widget advertising a ``Fixed`` size in a given dimension is a widget that will always consume the same number of rows or columns no matter how many it is given. Widgets can advertise different vertical and horizontal growth policies for example, the -``Brick.Widgets.Border.hCenter`` function centers a widget and is +``Brick.Widgets.Center.hCenter`` function centers a widget and is ``Greedy`` horizontally and defers to the widget it centers for vertical growth behavior.