More UI work

This commit is contained in:
2024-01-20 16:44:26 +01:00
parent c96db94de4
commit 8abc17034c
3 changed files with 33 additions and 8 deletions

View File

@@ -25,7 +25,8 @@ public abstract class UIElement
public void Render(Renderer renderer)
{
renderer.SetTransform(Rect.Position, Vector2.Zero, 0);
Vector2 parentPos = parent != null ? parent.Rect.Position : Vector2.Zero;
renderer.SetTransform(Rect.Position + parentPos, Vector2.Zero, 0);
OnRender(renderer);
foreach (UIElement child in children)