fix jittery gui tooltips
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 2m13s
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 2m13s
This commit is contained in:
parent
f6c8fe11e8
commit
7c4aa7d33c
1 changed files with 3 additions and 3 deletions
|
@ -28,7 +28,7 @@ public class GUIManager {
|
||||||
Map.Entry<Rectangle, Component>[] entries = renderedComponents.entrySet().toArray(new Map.Entry[0]);
|
Map.Entry<Rectangle, Component>[] entries = renderedComponents.entrySet().toArray(new Map.Entry[0]);
|
||||||
for (int i = 0, entriesSize = entries.length ; i < entriesSize ; i++) {
|
for (int i = 0, entriesSize = entries.length ; i < entriesSize ; i++) {
|
||||||
Map.Entry<Rectangle, Component> entry = entries[i];
|
Map.Entry<Rectangle, Component> entry = entries[i];
|
||||||
if(mouseX >= entry.getKey().getX() && mouseY >= entry.getKey().getY() && mouseX <= entry.getKey().getWidth() && mouseY <= entry.getKey().getHeight()) {
|
if(mouseX >= entry.getKey().getX() && mouseY >= entry.getKey().getY() && mouseX < entry.getKey().getWidth() && mouseY < entry.getKey().getHeight()) {
|
||||||
entry.getValue().click(mouseX - entry.getValue().loc.getX(), mouseY - entry.getValue().loc.getY(), mouseButton);
|
entry.getValue().click(mouseX - entry.getValue().loc.getX(), mouseY - entry.getValue().loc.getY(), mouseButton);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ public class GUIManager {
|
||||||
Map.Entry<Rectangle, Component>[] entries = renderedComponents.entrySet().toArray(new Map.Entry[0]);
|
Map.Entry<Rectangle, Component>[] entries = renderedComponents.entrySet().toArray(new Map.Entry[0]);
|
||||||
for (int i = 0, entriesSize = entries.length; i < entriesSize ; i++) {
|
for (int i = 0, entriesSize = entries.length; i < entriesSize ; i++) {
|
||||||
Map.Entry<Rectangle, Component> entry = entries[i];
|
Map.Entry<Rectangle, Component> entry = entries[i];
|
||||||
if (mouseX >= entry.getKey().getX() && mouseY >= entry.getKey().getY() && mouseX <= entry.getKey().getWidth() && mouseY <= entry.getKey().getHeight()) {
|
if (mouseX >= entry.getKey().getX() && mouseY >= entry.getKey().getY() && mouseX < entry.getKey().getWidth() && mouseY < entry.getKey().getHeight()) {
|
||||||
dragging = entry.getValue();
|
dragging = entry.getValue();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ public class GUIManager {
|
||||||
Map.Entry<Rectangle, Component>[] entries = renderedComponents.entrySet().toArray(new Map.Entry[0]);
|
Map.Entry<Rectangle, Component>[] entries = renderedComponents.entrySet().toArray(new Map.Entry[0]);
|
||||||
for (int i = 0, entriesSize = entries.length ; i < entriesSize ; i++) {
|
for (int i = 0, entriesSize = entries.length ; i < entriesSize ; i++) {
|
||||||
Map.Entry<Rectangle, Component> entry = entries[i];
|
Map.Entry<Rectangle, Component> entry = entries[i];
|
||||||
if(mouseX >= entry.getKey().getX() && mouseY >= entry.getKey().getY() && mouseX <= entry.getKey().getWidth() && mouseY <= entry.getKey().getHeight()) {
|
if(mouseX >= entry.getKey().getX() && mouseY >= entry.getKey().getY() && mouseX < entry.getKey().getWidth() && mouseY < entry.getKey().getHeight()) {
|
||||||
entry.getValue().hover(mouseX - entry.getValue().loc.getX(), mouseY - entry.getValue().loc.getY());
|
entry.getValue().hover(mouseX - entry.getValue().loc.getX(), mouseY - entry.getValue().loc.getY());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue