fix jittery gui tooltips
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 2m13s

This commit is contained in:
Daniella / Tove 2024-06-12 21:42:50 +02:00
parent f6c8fe11e8
commit 7c4aa7d33c
Signed by: TudbuT
GPG key ID: B3CF345217F202D3

View file

@ -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;
} }