mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-21 04:32:18 +00:00
Merge pull request #1691 from MatthiasMann/gui_tooltip_locations
adjust tooltip location when moving a button - fixes #1609
This commit is contained in:
commit
56b697d684
1 file changed
+9
-5
@@ -43,7 +43,6 @@ public class IconButtonEIO extends GuiButton {
|
||||
if(toolTip == null) {
|
||||
toolTip = new GuiToolTip(new Rectangle(xOrigin, yOrigin, width, height), tooltipText);
|
||||
//gui.addToolTip(toolTip);
|
||||
toolTip.setBounds(new Rectangle(xPosition, yPosition, width, height));
|
||||
} else {
|
||||
toolTip.setToolTipText(tooltipText);
|
||||
}
|
||||
@@ -66,17 +65,22 @@ public class IconButtonEIO extends GuiButton {
|
||||
public void setSize(int width, int height) {
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
if(toolTip != null) {
|
||||
toolTip.setBounds(new Rectangle(xPosition, yPosition, width, height));
|
||||
}
|
||||
updateTooltipBounds();
|
||||
}
|
||||
|
||||
public IconButtonEIO setPosition(int x, int y) {
|
||||
this.xOrigin = x;
|
||||
this.yOrigin = y;
|
||||
updateTooltipBounds();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
private void updateTooltipBounds() {
|
||||
if(toolTip != null) {
|
||||
toolTip.setBounds(new Rectangle(xOrigin, yOrigin, width, height));
|
||||
}
|
||||
}
|
||||
|
||||
public IconButtonEIO setIconMargin(int x, int y) {
|
||||
marginX = x;
|
||||
marginY = y;
|
||||
|
||||
Reference in new issue
Block a user