forked from Mirrors/openclonk
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
parent
80676c7ab5
commit
8418da86d6
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue