Reset the scrollbars when moving between dex pages

This commit is contained in:
Sollace 2022-09-10 17:30:25 +02:00
parent 06268b70ca
commit bfe5f2e3b9

View file

@ -47,6 +47,8 @@ public class SpellbookTraitDexPageContent extends DrawableHelper implements Spel
rightPage.init(screen, page + 1);
screen.addPageButtons(187, 30, 350, incr -> {
offset = MathHelper.clamp(offset + incr, 0, (int)Math.ceil(traits.length / 2F) - 1);
leftPage.scrollbar.scrollBy(leftPage.scrollbar.getVerticalScrollAmount());
rightPage.scrollbar.scrollBy(rightPage.scrollbar.getVerticalScrollAmount());
});
}