Make coordinate calculation more robust, implement Flex widget type

This commit is contained in:
uramer 2022-04-04 23:10:03 +02:00
parent fbc84465c5
commit 788745e004
10 changed files with 181 additions and 25 deletions

View file

@ -39,8 +39,7 @@ namespace LuaUi
if (mCaption)
mCaption->setCaption(propertyValue("caption", std::string()));
mMoveResize = MyGUI::IntCoord();
setForcedCoord(mMoveResize);
clearForced();
WidgetExtension::updateProperties();
}
@ -70,11 +69,8 @@ namespace LuaUi
change.width *= (left - mPreviousMouse.left);
change.height *= (top - mPreviousMouse.top);
mMoveResize = mMoveResize + change.size();
setForcedCoord(mMoveResize);
// position can change based on size changes
mMoveResize = mMoveResize + change.point() + getPosition() - calculateCoord().point();
setForcedCoord(mMoveResize);
mMoveResize = mMoveResize + change;
forceCoord(mMoveResize);
updateCoord();
mPreviousMouse.left = left;