Commit 1a8e789e authored by bitplane's avatar bitplane

make IGUIElement::addChild call updateAbsolutePosition, reported by CuteAlien

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2265 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 738954d3
......@@ -44,14 +44,6 @@ public:
if (parent)
parent->addChild(this);
// if we succeeded in becoming a child
if (Parent)
{
LastParentRect = Parent->getAbsolutePosition();
AbsoluteRect += LastParentRect.UpperLeftCorner;
AbsoluteClippingRect = AbsoluteRect;
AbsoluteClippingRect.clipAgainst(Parent->AbsoluteClippingRect);
}
}
......@@ -398,15 +390,15 @@ public:
{
if (child)
{
child->grab();
child->grab(); // prevent destruction when removed
child->remove(); // remove from old parent
child->LastParentRect = getAbsolutePosition();
child->Parent = this;
Children.push_back(child);
child->updateAbsolutePosition();
}
}
//! Removes a child.
virtual void removeChild(IGUIElement* child)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment