fix popup coords iterator

This commit is contained in:
vaxerski 2022-08-27 14:11:23 +02:00
parent c46be7346e
commit 78491f7092

View file

@ -18,13 +18,19 @@
void addPopupGlobalCoords(void* pPopup, int* x, int* y) {
SXDGPopup *const PPOPUP = (SXDGPopup*)pPopup;
auto curPopup = PPOPUP;
int px = 0;
int py = 0;
auto curPopup = PPOPUP;
while (true) {
px += curPopup->popup->current.geometry.x - curPopup->popup->base->current.geometry.x;
py += curPopup->popup->current.geometry.y - curPopup->popup->base->current.geometry.y;
px += curPopup->popup->current.geometry.x;
py += curPopup->popup->current.geometry.y;
if (curPopup == PPOPUP) {
px -= curPopup->popup->base->current.geometry.x;
py -= curPopup->popup->base->current.geometry.y;
}
// fix oversized fucking popups
// kill me