mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 18:57:32 +00:00
Fixed grid mouse wheel code running outside of grid
This commit is contained in:
1 parent
a4bca99126
commit
5f04b6fa69
1 file changed
+5
-1
@@ -104,7 +104,7 @@ public class Grid {
|
||||
//////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Zoom logic
|
||||
if (wheel != 0 && !parent.presetOverlay.showOverlay) {
|
||||
if (wheel != 0 && !parent.presetOverlay.showOverlay&& isMouseOver(mouseX,mouseY)) {
|
||||
float xRate = zoomX < 15 ? 1.1f : 1.25f;
|
||||
float yRate = zoomY < 15 ? 1.1f : 1.25f;
|
||||
|
||||
@@ -157,6 +157,10 @@ public class Grid {
|
||||
GL11.glDisable(GL11.GL_SCISSOR_TEST);
|
||||
}
|
||||
|
||||
public boolean isMouseOver(int mouseX, int mouseY) {
|
||||
return mouseX >= startX && mouseX <= startX + width && mouseY >= startY && mouseY <= startY + height;
|
||||
}
|
||||
|
||||
public void zoom(int mouseX, int mouseY, int wheel) {
|
||||
///////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////
|
||||
|
||||
Reference in new issue
Block a user