-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using a Negative Margin on a BlockElement Breaks Height Calculation #32
Comments
Please post a complete example which reproduces the problem (MCVE). In case you've put the element with negative margins at the root, you won't get the library to output text above the caret. It always produces one rectangular area and prints it with Console methods. What are you trying to achieve with negative margins? Maybe there's a simpler way to do that. |
What you need is a horizonal stacking container: var doc = new Document(
new Stack {
Orientation = Horizontal,
Children = {
resultsHeaderSpan,
resultsTableWithCountDiv,
},
}
); You can also use a docking container: var doc = new Document(
new Dock(
new Span("Results") { [Dock.ToProperty] = Left },
new Span("Count") { [Dock.ToProperty] = Bottom },
new Grid { ... },
)
); Grid would work too. Not sure why exactly your approach doesn't work, but this should solve the problem in a clean way. |
Thanks! I like the Stack better, more readable than the Dock in my opinion, tried it out and it works perfect. I seen these elements mentioned in the readme but I didn't think to try them out because I didn't know what they did. |
I've tried using a negative top margin on a block element like this:
I've added some children to this element that should span 6 lines in height. Using the -1 top margin causes the element to only have a height of 1 line and the other lines are missing.
It will only render with the correct height if I remove the negative margin. It also seems to work okay if I use a bottom margin like this, but this causes an extra line to render after my div which is not what I want:
The text was updated successfully, but these errors were encountered: