mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-29 05:17:58 +03:00
Update parent coords when updating element
This commit is contained in:
parent
4a4cef5709
commit
a36360cbde
2 changed files with 11 additions and 0 deletions
|
@ -79,6 +79,14 @@ namespace LuaUi
|
||||||
destroyWidget(ext);
|
destroyWidget(ext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void updateRootCoord(LuaUi::WidgetExtension* ext)
|
||||||
|
{
|
||||||
|
LuaUi::WidgetExtension* root = ext;
|
||||||
|
while (root->getParent())
|
||||||
|
root = root->getParent();
|
||||||
|
root->updateCoord();
|
||||||
|
}
|
||||||
|
|
||||||
WidgetExtension* createWidget(const sol::table& layout, uint64_t depth);
|
WidgetExtension* createWidget(const sol::table& layout, uint64_t depth);
|
||||||
void updateWidget(WidgetExtension* ext, const sol::table& layout, uint64_t depth);
|
void updateWidget(WidgetExtension* ext, const sol::table& layout, uint64_t depth);
|
||||||
|
|
||||||
|
@ -246,6 +254,7 @@ namespace LuaUi
|
||||||
mRoot = createWidget(layout(), 0);
|
mRoot = createWidget(layout(), 0);
|
||||||
mLayer = setLayer(mRoot, layout());
|
mLayer = setLayer(mRoot, layout());
|
||||||
updateAttachment();
|
updateAttachment();
|
||||||
|
updateRootCoord(mRoot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,6 +273,7 @@ namespace LuaUi
|
||||||
}
|
}
|
||||||
mLayer = setLayer(mRoot, layout());
|
mLayer = setLayer(mRoot, layout());
|
||||||
updateAttachment();
|
updateAttachment();
|
||||||
|
updateRootCoord(mRoot);
|
||||||
}
|
}
|
||||||
mUpdate = false;
|
mUpdate = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@ namespace LuaUi
|
||||||
WidgetExtension* slot() const { return mSlot; }
|
WidgetExtension* slot() const { return mSlot; }
|
||||||
|
|
||||||
bool isRoot() const { return mElementRoot; }
|
bool isRoot() const { return mElementRoot; }
|
||||||
|
WidgetExtension* getParent() const { return mParent; }
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue