forked from mirrors/kolyah35-minecraft-pe-0.6.1
Fix to prevent text overlap in options list during scroll
This commit is contained in:
parent
162ec7adfa
commit
b3561e773d
1 changed files with 12 additions and 1 deletions
|
|
@ -7,6 +7,7 @@
|
|||
#include "TextOption.h"
|
||||
#include "KeyOption.h"
|
||||
#include <algorithm>
|
||||
#include "../Gui.h"
|
||||
#include "../Screen.h"
|
||||
#include "../../../platform/input/Mouse.h"
|
||||
#include "../../../util/Mth.h"
|
||||
|
|
@ -56,10 +57,20 @@ void OptionsGroup::setupPositions() {
|
|||
void OptionsGroup::render( Minecraft* minecraft, int xm, int ym ) {
|
||||
float padX = 10.0f;
|
||||
float padY = 5.0f;
|
||||
const int labelHeight = 18;
|
||||
|
||||
minecraft->font->draw(label, (float)x + padX, (float)y + padY, 0xffffffff, false);
|
||||
|
||||
glEnable2(GL_SCISSOR_TEST);
|
||||
glScissor(
|
||||
Gui::GuiScale * x,
|
||||
minecraft->height - Gui::GuiScale * (y + height),
|
||||
Gui::GuiScale * width,
|
||||
Gui::GuiScale * (height - labelHeight)
|
||||
);
|
||||
|
||||
super::render(minecraft, xm, ym);
|
||||
glDisable2(GL_SCISSOR_TEST);
|
||||
}
|
||||
|
||||
void OptionsGroup::tick(Minecraft* minecraft) {
|
||||
|
|
@ -216,4 +227,4 @@ void OptionsGroup::createKey(OptionId optId, Minecraft* minecraft) {
|
|||
OptionsItem* item = new OptionsItem(optId, itemLabel, element);
|
||||
addChild(item);
|
||||
setupPositions();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue