fix tooltip causing crash
This commit is contained in:
parent
7004c9ef4d
commit
54917091de
|
@ -77,7 +77,6 @@ public class UI {
|
||||||
|
|
||||||
// game-related variables
|
// game-related variables
|
||||||
private static DisplayContainer displayContainer;
|
private static DisplayContainer displayContainer;
|
||||||
private static Input input;
|
|
||||||
|
|
||||||
// This class should not be instantiated.
|
// This class should not be instantiated.
|
||||||
private UI() {}
|
private UI() {}
|
||||||
|
@ -360,7 +359,8 @@ public class UI {
|
||||||
textWidth += Fonts.SMALL.getWidth(tooltip);
|
textWidth += Fonts.SMALL.getWidth(tooltip);
|
||||||
|
|
||||||
// get drawing coordinates
|
// get drawing coordinates
|
||||||
int x = input.getMouseX() + offset, y = input.getMouseY() + offset;
|
int x = displayContainer.mouseX + offset;
|
||||||
|
int y = displayContainer.mouseY + offset;
|
||||||
if (x + textWidth > displayContainer.width - margin)
|
if (x + textWidth > displayContainer.width - margin)
|
||||||
x = displayContainer.width - margin - textWidth;
|
x = displayContainer.width - margin - textWidth;
|
||||||
else if (x < margin)
|
else if (x < margin)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user