Hi,
i`m currently working on a synthesizer program where i can place my virtual devices on a virtual desktop, which i can Zoom and Pan:
This works fine now, thanks to the sf::View
But... if i Zoom-In with the Mousewheel i also would like to pan the whole virtual desktop to the Device where the Mouse points to.
At first i thought this would be simple, if i would set the View-Center to the current Mouse-Coordinates, but unfortunately this does not seem to work so simple (if i try it this way the whole desktop-panning flickers in all directions).
Please take a look at my attached screenshot and imagine that the user points the mouse over the Device "Grainshifter" and rotates the Mousewheel. In this case the virtual desktop not only should Zoom In - it also should scroll to the device where the mouse points to. I often see this behavior in similar programs but i have no idea how i could implement this (currently the Zoom works only with the Center-Point set to the center of the whole screen).
I also found a similar question in this forum, but it was not answered there.
Does someone have a idea how to implement this?
Please excuse my bad english
Regards,
M74