Almost every Graphic Editor allows to zoom the image and a "working area background" with a Ctrl + mouse wheel.
The tricky part is that there are many UI elements involved:
- "working area background" - that darker area behind the image that is zoomed
- scrollbars which are updated correctly and can be used to pan around the working area
- actual image (that blue blueprint pattern) - element that visually get's zoomed
Notice that the zooming behavior is different depending on whether the mouse pointer was above the image or not:
- if it's above the image then image get's zoomed and moved
- if it's above the "working area background" then the image only get's zoomed and keeps it's position
- note: scrollbars are updated in both cases!
It seems to be nicely implemented decades ago.
Are there any open-source projects with a similar "zoom + move + scrollbars" behavior to look at their code and learn from it?
Thanks!
