fix: render right margin for block stack elements
This PR addresses a bug I was encountering with fixing up #324. It updates the way the block stack width is calculated. Instead of multiplying the indent and margin size, those two are added together. That seems to match how those two are used in the MarginWriter used by most block elements.
I also updated the Header so that it uses MarginWriter like the other block elements (so padding and such is applied the same way)
Note: This change does seem to result in a global drop in the rendered width by 1-2 spaces since we're evaluating the width and margin as 0 in most cases.
Fixes: #331
Here are a couple of images to demonstrate the spacing / padding rendered now:
When setting the padding character in MarginWriter to "+"
When updating the document background color
I was looking at this as well but to me it seems like we would have to use margin*2, see my comment for details.
I was looking at this as well but to me it seems like we would have to use
margin*2, see my comment for details.
Great catch and great explanation @maxmoehl. I'll push up an update here
Could someone see into merging this? It's a canonical party pooper.
hey, thanks for the PR, sorry for the delay on merging it :)