1
0
Fork 0

Bugfix: stop dialogs jumping around when re-layout occurs - make positions persistent.

This commit is contained in:
jmt 2010-02-15 23:34:53 +00:00 committed by Tim Moore
parent edd83dd7e8
commit 26361f2f5a

View file

@ -295,8 +295,16 @@ int fgPopup::checkHit(int button, int updown, int x, int y)
getFirstChild()->setSize(w, h); // dialog background puFrame
}
} else {
setPosition(x + _dlgX - _startX, y + _dlgY - _startY);
}
int posX = x + _dlgX - _startX,
posY = y + _dlgY - _startY;
setPosition(posX, posY);
GUIInfo *info = (GUIInfo *)getUserData();
if (info && info->node) {
info->node->setIntValue("x", posX);
info->node->setIntValue("y", posY);
}
} // re-positioning
} else if (_dragging) {
fgSetMouseCursor(_start_cursor);