Apply an anchor offset for Anchor.TopRight too.
This commit is contained in:
@@ -142,7 +142,7 @@ public class TestGame : Game
|
||||
private HorizontalContainer _container = new(new Rect(128.0f, 64.0f), new(), 16)
|
||||
{
|
||||
ConfineToContents = true,
|
||||
Anchor = Anchor.TopCenter,
|
||||
AnchorOffset = new Vector2(0.5f, 0.0f)
|
||||
Anchor = Anchor.TopRight,
|
||||
AnchorOffset = new Vector2(1.0f, 0.0f)
|
||||
};
|
||||
}
|
||||
@@ -185,7 +185,7 @@ public abstract class Container : IElement, IParentableElement, IUpdatableElemen
|
||||
Position = new Vector2(parentPosition.X + topCenterX, topCenterY) - absoluteOffset;
|
||||
break;
|
||||
case Anchor.TopRight:
|
||||
Position = new Vector2(parentPosition.X + parentRect.Width, parentPosition.Y);
|
||||
Position = new Vector2(parentPosition.X + parentRect.Width, parentPosition.Y) - absoluteOffset;
|
||||
break;
|
||||
|
||||
case Anchor.Fill:
|
||||
|
||||
Reference in New Issue
Block a user