fixed child removal
fixed relayout on draw refactored child remove/replace into ScrollPanelWidget fixed scrolling on child remove
This commit is contained in:
@@ -50,6 +50,25 @@ namespace OpenRA.Widgets
|
||||
base.AddChild(child);
|
||||
}
|
||||
|
||||
public override void RemoveChild(Widget child)
|
||||
{
|
||||
base.RemoveChild(child);
|
||||
Layout.AdjustChildren();
|
||||
Scroll(0);
|
||||
}
|
||||
|
||||
public void ReplaceChild(Widget oldChild, Widget newChild)
|
||||
{
|
||||
|
||||
oldChild.Removed();
|
||||
newChild.Parent = this;
|
||||
Children[Children.IndexOf(oldChild)] = newChild;
|
||||
Layout.AdjustChildren();
|
||||
Scroll(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override void DrawOuter()
|
||||
{
|
||||
if (!IsVisible())
|
||||
@@ -95,8 +114,6 @@ namespace OpenRA.Widgets
|
||||
|
||||
Game.Renderer.EnableScissor(backgroundRect.X + 1, backgroundRect.Y + 1, backgroundRect.Width - 2, backgroundRect.Height - 2);
|
||||
|
||||
Layout.AdjustChildren();
|
||||
|
||||
foreach (var child in Children)
|
||||
child.DrawOuter();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user