Skip to content

Commit

Permalink
fix: CustomElementの子要素が親を持たない不具合を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
EbiseLutica committed Feb 22, 2024
1 parent 3b86557 commit d8cf0eb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion Promete/Elements/Container.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public void RemoveAt(int index)

public void Add(ElementBase item)
{
children.Add(item);
item.Parent = this;
}

Expand Down
1 change: 1 addition & 0 deletions Promete/Elements/CustomElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ internal override void Update()
base.Update();
for (var i = 0; i < children.Count; i++)
{
children[i].Parent = this;
children[i].Update();
}
}
Expand Down
2 changes: 1 addition & 1 deletion Promete/Elements/ElementBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public int Height
public Vector AbsoluteScale => Parent == null ? Scale : Scale * Parent.AbsoluteScale;
public float AbsoluteAngle => Parent == null ? Angle : Angle + Parent.AbsoluteAngle;

public Container? Parent { get; internal set; }
public ElementBase? Parent { get; internal set; }

private readonly List<Component> components = [];

Expand Down

0 comments on commit d8cf0eb

Please sign in to comment.