make studio map zoom in on the cursor target

This commit is contained in:
Julian Krings 2025-08-08 21:40:36 +02:00
parent 3e1143112a
commit bd1b06c761
No known key found for this signature in database
GPG Key ID: 208C6E08C3B718D2

View File

@ -815,11 +815,28 @@ public class VisionGUI extends JPanel implements MouseWheelListener, KeyListener
return;
}
//Iris.info("Blocks/Pixel: " + (mscale) + ", Blocks Wide: " + (w * mscale));
double m0 = mscale;
double m1 = m0 + ((0.25 * m0) * notches);
m1 = Math.max(m1, 0.00001);
if (m1 == m0) {
return;
}
positions.clear();
fastpositions.clear();
mscale = mscale + ((0.25 * mscale) * notches);
mscale = Math.max(mscale, 0.00001);
Point p = e.getPoint();
double sx = p.getX();
double sz = p.getY();
double newOxp = scale * ((m0 / m1) * (sx + (oxp / scale)) - sx);
double newOzp = scale * ((m0 / m1) * (sz + (ozp / scale)) - sz);
mscale = m1;
oxp = newOxp;
ozp = newOzp;
ox = oxp;
oz = ozp;
}
@Override