Skip to content

Commit 1dd6b21

Browse files
committed
hCenterWith: account for centered image width properly when computing additional right padding (see also #520)
1 parent 2652a19 commit 1dd6b21

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Brick/Widgets/Center.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ hCenterWith mChar p =
6060
c <- getContext
6161
let rWidth = result^.imageL.to imageWidth
6262
rHeight = result^.imageL.to imageHeight
63-
remainder = max 0 $ c^.availWidthL - (leftPaddingAmount * 2)
63+
remainder = max 0 $ c^.availWidthL - (rWidth + (leftPaddingAmount * 2))
6464
leftPaddingAmount = max 0 $ (c^.availWidthL - rWidth) `div` 2
6565
rightPaddingAmount = max 0 $ leftPaddingAmount + remainder
6666
leftPadding = charFill (c^.attrL) ch leftPaddingAmount rHeight

0 commit comments

Comments
 (0)