fairyring: Don't loose scroll position

Fixes #5531
This commit is contained in:
Max Weber
2018-10-02 05:09:37 -06:00
parent dc988a56e4
commit c7740d29d2

View File

@@ -356,13 +356,19 @@ public class FairyRingPlugin extends Plugin
y = 0;
}
int newHeight = 0;
if (list.getScrollHeight() > 0)
{
newHeight = (list.getScrollY() * y) / list.getScrollHeight();
}
list.setScrollHeight(y);
list.revalidateScroll();
client.runScript(
ScriptID.UPDATE_SCROLLBAR,
WidgetInfo.FAIRY_RING_LIST_SCROLLBAR.getId(),
WidgetInfo.FAIRY_RING_LIST.getId(),
0
newHeight
);
}
}