Login  Register

Re: Pan on mouse wheel zoom implemented.

Posted by dxli on Dec 09, 2024; 9:03pm
URL: https://forum.librecad.org/Pan-on-mouse-wheel-zoom-implemented-tp5725784p5725785.html

Hi John found,

No problem, I will add your changes ASAP.

Zooming is a source of complaints for LibreCAD. Mostly, due to accidental large zooming changes.

It helps to speed up, if you could push to your own fork, and send in pull requests.

Coding expertise is not a concern here, since we can tweak the code together in a PR before merging.


johnfound wrote
Well, as I already somewhere wrote, this is a feature that I badly miss in LibreCad and here it is:

pan-on-zoom.diff

It is controlled from two options in the Application Preferences dialog:



The first enables and disables the pan-on-zoom feature. If it is checked, on mouse wheel, the point where the mouse cursor is located will be scrolled at the center of the window, together with the mouse cursor. This way, you can pan only with the wheel, without pressing it and dragging.

The second option, if checked, will inhibit the zoom if the mouse cursor is far from the center of the screen. This way, the first wheel event will not zoom, and only pan the view to the center. Pretty useful for browsing big drawings without zoom-in-out all the time.

I am not very good in explanations - simply patch and try yourself.

I am not a good C++ programmer, so the quality of the code might be low. I even can't estimate it...

Any suggestions, notes and critic are welcome.