custom GUIs: fixed scrollbar offset with active upper board (#1612)

I guess the UI elements expect their position to already be corrected by cgo.X/Y. Or they never cared because they were in front of the upper board.
I am not sure, maybe the correct solution would be to actually position all elements lower (instead of adjusting for it when passing mouse input or drawing)? Currently the position is relative to the upper board's edge.

Anyway, this works for now.
objectmenu
David Dormagen 2016-01-21 22:15:14 +01:00
parent 80676c7ab5
commit 8418da86d6
1 changed files with 5 additions and 1 deletions

View File

@ -1533,8 +1533,12 @@ bool C4ScriptGuiWindow::DrawChildren(C4TargetFacet &cgo, int32_t player, int32_t
if (oneDrawn && (withMultipleFlag == 0)) break;
}
// scrolling obviously does not affect the scroll bar
// Scrolling obviously does not affect the scroll bar.
cgo.TargetY += iScrollY;
// The scroll bar does not correct for the cgo offset (i.e. the upper board).
cgo.TargetX += cgo.X;
cgo.TargetY += cgo.Y;
if (pScrollBar->IsVisible())
pScrollBar->DrawElement(cgo);