diff --git a/Engine.Core/Transform.cs b/Engine.Core/Transform.cs index 0307ac4..db23dc6 100644 --- a/Engine.Core/Transform.cs +++ b/Engine.Core/Transform.cs @@ -52,7 +52,7 @@ public class Transform : ITransform public Vector2D Scale { - get => _scale; + get => _localScale.Scale(Parent?.Scale ?? Vector2D.One); set { if (value == _scale) @@ -66,7 +66,7 @@ public class Transform : ITransform public float Rotation { - get => _rotation; + get => _localRotation * (Parent?.Rotation ?? 1f); set { if (value == _rotation) @@ -239,9 +239,9 @@ public class Transform : ITransform private void UpdatePosition() { if (Parent is null) - _position = LocalPosition.Scale(Vector2D.One).Rotate(0f * Math.DegreeToRadian); + _position = LocalPosition.Rotate(0f * Math.DegreeToRadian); else - _position = Parent.Position + LocalPosition.Scale(new(1f / Parent.Scale.X, 1f / Parent.Scale.Y)).Rotate(Parent.Rotation * Math.DegreeToRadian); + _position = Parent.Position + LocalPosition.Scale(new(Parent.Scale.X, Parent.Scale.Y)).Rotate(Parent.Rotation * Math.DegreeToRadian); } private void UpdateScale()