Avogadro version: Latest Nightly
Operating system and version: Windows 11 Pro 10.0.26200
Expected Behavior
Scroll wheel follows desired setting in Navigate tool options, e.g. scrolling down zooms out, scrolling up zooms in, can do reverse if enabled.
Actual Behavior
Sometimes the scroll wheel can seem to get locked into zooming out.
Steps to Reproduce
It’s not easy to reproduce consistently, but one way that seems to work for me is opening up the attached file and dragging the molecule so that it is centered in the screen, then the scrolling only zooms out.
I’m having a hard time reproducing the bug on my desktop, but I know that on my laptop it definitely occurs in orthographic. I rarely ever use perspective so I’m not sure about that.
Edit: Just tried on my laptop. I can’t reproduce it with perspective, only orthographic.
Yes, there seems to be something buggy in the orthographic projection camera code. I’ll sort through it. (This may also be the root cause of the selection bug in orthographic mode.)
For what it’s worth, in my experiments, it seems like View => Center or View => Align to Axes before anything else prevents the problem.
Put another way, the initial camera matrix seems prone to this issue in orthographic projection, while the code in resetview.cpp sets up a better camera transform. I’ll now work towards:
migrating the “Align to Axes” code to be the default camera
tweaking the default zoom level .. sometimes it’s a bit off
I’ll also add in some code to copy / paste the camera e.g., “Copy View” and “Paste View” to avogadroapp
Okay, this should be fixed now by a patch to avogadroapp … basically it wasn’t properly resetting the camera when you actually read a molecule, so it was stuck on the default for zero atoms. Oops.
I still need to sort out a better default zoom for orthographic projection (and make sure it resets accordingly with Center and Align to Axes menu items).
Windows build just finished. Looks good to me so far, will do some more testing tomorrow morning with my laptop. I do like that switching to orthographic doesn’t just zoom in beyond belief anymore.
Yeah, I fixed up a few other bits because zoom in orthographic mode is different than perspective, so the “Center” and other commands in the View menu now reset the zoom.