forked from Kolyah35/minecraft-pe-0.6.1
Fix to prevent text overlap in options list during scroll
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
#include "TextOption.h"
|
#include "TextOption.h"
|
||||||
#include "KeyOption.h"
|
#include "KeyOption.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include "../Gui.h"
|
||||||
#include "../Screen.h"
|
#include "../Screen.h"
|
||||||
#include "../../../platform/input/Mouse.h"
|
#include "../../../platform/input/Mouse.h"
|
||||||
#include "../../../util/Mth.h"
|
#include "../../../util/Mth.h"
|
||||||
@@ -56,10 +57,20 @@ void OptionsGroup::setupPositions() {
|
|||||||
void OptionsGroup::render( Minecraft* minecraft, int xm, int ym ) {
|
void OptionsGroup::render( Minecraft* minecraft, int xm, int ym ) {
|
||||||
float padX = 10.0f;
|
float padX = 10.0f;
|
||||||
float padY = 5.0f;
|
float padY = 5.0f;
|
||||||
|
const int labelHeight = 18;
|
||||||
|
|
||||||
minecraft->font->draw(label, (float)x + padX, (float)y + padY, 0xffffffff, false);
|
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);
|
super::render(minecraft, xm, ym);
|
||||||
|
glDisable2(GL_SCISSOR_TEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OptionsGroup::tick(Minecraft* minecraft) {
|
void OptionsGroup::tick(Minecraft* minecraft) {
|
||||||
@@ -216,4 +227,4 @@ void OptionsGroup::createKey(OptionId optId, Minecraft* minecraft) {
|
|||||||
OptionsItem* item = new OptionsItem(optId, itemLabel, element);
|
OptionsItem* item = new OptionsItem(optId, itemLabel, element);
|
||||||
addChild(item);
|
addChild(item);
|
||||||
setupPositions();
|
setupPositions();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user