Hi guys
I have a image tool I am working on. I zoom to the mouse location using the following code:
float x = float(imgrender.mx - imgrender.bgx);
float y = float(imgrender.my - imgrender.bgy);
float pscale = imgrender.bgscale;
imgrender.bgscale = max(min(imgrender.bgscale + (zDelta > 0 ? 0.1f : -0.1f), 100.0f), 0.20f);
float newx = x * (imgrender.bgscale / pscale);
float newy = y * (imgrender.bgscale / pscale);
imgrender.bgx += (x - newx);
imgrender.bgy += (y - newy);
I then take the bgx/bgy values, and set them to my viewport Topleft X/Y coordinates …