osu-framework icon indicating copy to clipboard operation
osu-framework copied to clipboard

`TextFlowContainer` incorrectly performs text layout with `TextAnchor` = `TopRight` & `CenterRight`

Open jai-x opened this issue 2 years ago • 1 comments

Code:

new Container
{
    Size = new Vector2(100, 300),
    Children = new Drawable[]
    {
        new Box
        {
            Name = "Background",
            RelativeSizeAxes = Axes.Both,
            Alpha = 0.1f
        },
        new TextFlowContainer
        {
            RelativeSizeAxes = Axes.Both,
            TextAnchor = Anchor.TopRight,
            Text = "This is using TextAnchor TopRight"
        },
        new TextFlowContainer
        {
            RelativeSizeAxes = Axes.Both,
            TextAnchor = Anchor.CentreRight,
            Text = "This is using TextAnchor CentreRight"
        },
        new TextFlowContainer
        {
            RelativeSizeAxes = Axes.Both,
            TextAnchor = Anchor.BottomRight,
            Text = "This is using TextAnchor BottomRight"
        },
    },
}

Result: image

jai-x avatar Mar 29 '22 21:03 jai-x

related: https://github.com/ppy/osu/issues/8580

bdach avatar Mar 29 '22 21:03 bdach