Replies: 1 comment
|
This does not look like a A couple of things are worth separating here:
For the sample as written, I would first try removing mainTextBlock.Inlines?.Add(new InlineUIContainer
{
Child = new Button()
{
Padding = new(0),
Margin = new(0),
BorderThickness = new(0),
FontSize = 30,
Content = "button"
},
BaselineAlignment = BaselineAlignment.Baseline
});If your real case is only styled inline text, avoid mainTextBlock.Inlines?.Add(new Run("1d8 Psychic damage")
{
Foreground = Brushes.Red
});If the child really needs to be interactive, then A few details would make this easier to confirm as a framework bug:
As a workaround, if you need this to ship today, the most stable options are either using real text inlines for non-interactive colored text, or laying the tokens out with a wrapping panel / items control instead of embedding controls in a If my answer solved your problem, you can click answered the question. I'm really here to help, and along the way I'm also collecting Galaxy Brain badges haha 😆 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'm trying to render some buttons inline in a TextBlock using InlineUIContainer. However I find that the buttons are offset from baseline, and the amount of offset varies line by line.
It's not unique to Button; when using inline TextBlocks the issue still occurs.
Latest Avalonia version (12.0.5). Am I doing something wrong, or is this a bug? Thanks in advance.
Setup:
Render:
Not super visible there, but it can get bad (from my actual app):
All reactions