From bfe5f2e3b98c316a32d6ac538220d61ac07dda2e Mon Sep 17 00:00:00 2001 From: Sollace Date: Sat, 10 Sep 2022 17:30:25 +0200 Subject: [PATCH] Reset the scrollbars when moving between dex pages --- .../unicopia/container/SpellbookTraitDexPageContent.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/minelittlepony/unicopia/container/SpellbookTraitDexPageContent.java b/src/main/java/com/minelittlepony/unicopia/container/SpellbookTraitDexPageContent.java index bea992ed..a22b7ead 100644 --- a/src/main/java/com/minelittlepony/unicopia/container/SpellbookTraitDexPageContent.java +++ b/src/main/java/com/minelittlepony/unicopia/container/SpellbookTraitDexPageContent.java @@ -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()); }); }