fix optionmenu hover indicator misaligning at the bottom (itdelatrisu/opsu#243)

This commit is contained in:
yugecin 2017-02-03 16:24:26 +01:00
parent 284cebb063
commit 611e539c14

View File

@ -133,6 +133,8 @@ public class OptionsOverlay extends OverlayOpsuState {
private int sliderSoundDelay; private int sliderSoundDelay;
private int sectionLineHeight;
private final TextField searchField; private final TextField searchField;
private String lastSearchText; private String lastSearchText;
@ -172,6 +174,7 @@ public class OptionsOverlay extends OverlayOpsuState {
posSearchY = textChangeY + Fonts.MEDIUM.getLineHeight() * 2; posSearchY = textChangeY + Fonts.MEDIUM.getLineHeight() * 2;
textSearchYOffset = Fonts.MEDIUM.getLineHeight() / 2; textSearchYOffset = Fonts.MEDIUM.getLineHeight() / 2;
optionStartY = posSearchY + Fonts.MEDIUM.getLineHeight() + Fonts.LARGE.getLineHeight(); optionStartY = posSearchY + Fonts.MEDIUM.getLineHeight() + Fonts.LARGE.getLineHeight();
sectionLineHeight = (int) (Fonts.LARGE.getLineHeight() * 1.5f);
if (active) { if (active) {
width = finalWidth; width = finalWidth;
@ -326,8 +329,8 @@ public class OptionsOverlay extends OverlayOpsuState {
Fonts.MEDIUMBOLD.drawString(paddingTextLeft, lineStartY, section.name, COL_WHITE); Fonts.MEDIUMBOLD.drawString(paddingTextLeft, lineStartY, section.name, COL_WHITE);
} }
} }
y += Fonts.LARGE.getLineHeight() * 1.5f; y += sectionLineHeight;
maxScrollOffset += Fonts.LARGE.getLineHeight() * 1.5f; maxScrollOffset += sectionLineHeight;
if (section.options == null) { if (section.options == null) {
continue; continue;
} }
@ -789,7 +792,7 @@ public class OptionsOverlay extends OverlayOpsuState {
if (section.filtered) { if (section.filtered) {
continue; continue;
} }
mouseVirtualY -= Fonts.LARGE.getLineHeight() * 1.5f; mouseVirtualY -= sectionLineHeight;
if (section.options == null) { if (section.options == null) {
continue; continue;
} }