From 0e06ab62495fa475f2a09b9cc95d6f13b1792629 Mon Sep 17 00:00:00 2001 From: yugecin Date: Sun, 11 Dec 2016 16:36:29 +0100 Subject: [PATCH] make default tab actually work --- src/yugecin/opsudance/ui/OptionsOverlay.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/yugecin/opsudance/ui/OptionsOverlay.java b/src/yugecin/opsudance/ui/OptionsOverlay.java index 462b5f97..48511e22 100644 --- a/src/yugecin/opsudance/ui/OptionsOverlay.java +++ b/src/yugecin/opsudance/ui/OptionsOverlay.java @@ -98,7 +98,12 @@ public class OptionsOverlay { float tabY = Fonts.XLARGE.getLineHeight() + Fonts.DEFAULT.getLineHeight() + height * 0.015f - (tabImage.getHeight() / 2f); int tabOffset = Math.min(tabImage.getWidth(), width / tabs.length); maxScrollOffset = Fonts.MEDIUM.getLineHeight() * 2 * tabs.length; + scrollOffset = 0; for (OptionTab tab : tabs) { + if (defaultSelectedTabIndex-- > 0) { + scrollOffset += Fonts.MEDIUM.getLineHeight() * 2; + scrollOffset += tab.options.length * optionHeight; + } maxScrollOffset += tab.options.length * optionHeight; tab.button = new MenuButton(tabImage, tabX, tabY); tabX += tabOffset;