fix: now render tool tip correctly

- now label's in overlay can not modify amount by mouse scroll
This commit is contained in:
Discreater committed 2021-05-08 03:41:20 +08:00
1 parent 98ee8a04d4
commit b6d5a7a9fe
3 files changed
+3 -14

No files matched your search

@@ -296,7 +296,7 @@ public class JecaGui extends GuiContainer {
int i = 0;
int separators = 0;
for (String s : textLines) {
int j = this.fontRendererObj.getStringWidth(s);
int j = font.getStringWidth(s);
if (j > i)
i = j;
//noinspection StringEquality
@@ -560,7 +560,7 @@ public class JecaGui extends GuiContainer {
}
public void drawHoveringText(List<String> textLines, int x, int y) {
super.drawHoveringText(textLines, x, y, fontRendererObj);
this.drawHoveringText(textLines, x, y, fontRendererObj);
}
}
@@ -108,7 +108,7 @@ public class WContainer implements IContainer {
@Override
public WLabel getLabelUnderMouse(int xMouse, int yMouse) {
if(overlay != null && overlay.mouseIn(xMouse, yMouse)) {
return overlay.getLabelUnderMouse(xMouse, yMouse);
return null;
} else {
return new Utilities.ReversedIterator<>(widgets).stream()
.map(i -> i.getLabelUnderMouse(xMouse, yMouse))
@@ -63,17 +63,6 @@ public class WLabelScroll extends WContainer implements ISearchable {
scroll.setRatio(Math.min(row / (float) getAmountRows(), 1f)).setCurrent(f).setStep(step);
}
// @Override
// public boolean onMouseScroll(JecaGui gui, int xMouse, int yMouse, int diff) {
// boolean in = JecaGui.mouseIn(xPos, yPos, column * 18, row * 18, xMouse, yMouse);
// if (in) {
// float pos = getPos(current - diff);
// scroll.setCurrent(pos);
// update(pos);
// }
// return in;
// }
public WLabel get(int index) {
return labelGroup.get(index - column * current);
}