v0.12.3 weird zoom issue

145 views
Skip to first unread message

Israel Brewster

unread,
Oct 22, 2021, 2:00:50 PM10/22/21
to pyqtgraph
Just (finally!) got around to upgrading my project to pyqtgraph 0.12.3, and now rather than zooming around the mouse when using the “scroll wheel” (two-finger drag on the trackpad) to zoom in/out, it seems to zoom from some point on the left edge of the graph. Is this a change/issue with the new version of pyqtgraph, or something due to the many (many!) overrides/tweaks I have made to the behavior of pyqtgraph throughout my code?
---
Israel Brewster
Software Engineer
Alaska Volcano Observatory 
Geophysical Institute - UAF 
2156 Koyukuk Drive 
Fairbanks AK 99775-7320

Ognyan Moore

unread,
Oct 22, 2021, 3:50:09 PM10/22/21
to pyqt...@googlegroups.com
Hi Israel,

Good to hear from you.  We had a lot of changes in 0.12.3 (one day we'll do a release with only a few changes), but I can't think of anything that would have broken mouse behavior. 

That said, just yesterday, I did merge an issue that does effect zooming, the issue was noticeable when the grid was displayed; but the issue it addresses is/was quite old.  If you can, I would try and give `master` branch a chance, otherwise, if a minimum reproducible example is out of the question, I would attempt to do some kind of git bisect and see if you can zero in on the commit that started causing the problem to begin with.

Ogi

--
You received this message because you are subscribed to the Google Groups "pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyqtgraph+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/D7D8C7C8-266A-480C-967D-7E3E8660BD27%40alaska.edu.

Israel Brewster

unread,
Oct 26, 2021, 11:47:07 AM10/26/21
to pyqtgraph
Well, the minimal example I tried showed proper expected zoom behavior, so it must be something in my code, interacting with some innocuous change in PyQtGraph. Time to start digging!

---
Israel Brewster
Software Engineer
Alaska Volcano Observatory 
Geophysical Institute - UAF 
2156 Koyukuk Drive 
Fairbanks AK 99775-7320

Ognyan Moore

unread,
Oct 26, 2021, 12:17:34 PM10/26/21
to pyqt...@googlegroups.com
Hi Israel, 

We had another issue come in that might be related


For the "fun" of it, can you comment out the update method in ViewBox.py?

Depending on how easy it is to apply your patches to pyqtgraph within your example, could you try running a git-bisect from the master branch and see if you can zero in on the first problematic commit?

Israel Brewster

unread,
Oct 26, 2021, 1:00:35 PM10/26/21
to pyqtgraph
On Oct 22, 2021, at 11:49 AM, Ognyan Moore <ognyan...@gmail.com> wrote:

Hi Israel,

Good to hear from you.  We had a lot of changes in 0.12.3 (one day we'll do a release with only a few changes), but I can't think of anything that would have broken mouse behavior. 

That said, just yesterday, I did merge an issue that does effect zooming, the issue was noticeable when the grid was displayed; but the issue it addresses is/was quite old. 

Ok, this is interesting. Apparently my minimal reproducible example attempt was a bit *too* minimal. The problem *is* related to the grid being displayed, but *primarily* with a right axis. A left axis can display the grid without significant issue, and master branch does not fix the issue.

Actually, to be anal about it, even having the grid on the left axis seems to offset the zoom point by a few pixels at least - it is noticeably different than when there is no grid, in which scenario the zoom point “sticks” to the mouse quite well - but it is nowhere near as noticeable as when using a grid on the right axis.

If you can, I would try and give `master` branch a chance

Doesn’t seem to have helped. I tried with master branch, and the behavior was the same as with previous releases.

, otherwise, if a minimum reproducible example is out of the question, I would attempt to do some kind of git bisect and see if you can zero in on the commit that started causing the problem to begin with.

Yep, I’ll start working on that. 

For what it’s worth, it appears to be somewhere between the 0.12.1 release and the 0.12.2 release.

Minimal (more or less) code example that illustrates the three options attached. To test, try positioning the mouse cursor directly above a tick mark on the X axis (say, 40), then zoom in using the scroll wheel (or two-finger drag on the trackpad, if you have that configured - that’s what I have). If it behaves the same for you, the top graph (grid on right axis) will have the tick mark shooting off to the right, the middle graph (left axis grid) will have it moving slowly to the left, and the bottom graph (no grid) will more-or-less stay put (*might* have one or two pixel offset, but might just be my cursor positioning). You’ll probably want to make the window a lot bigger first though :-)

testZoom.py

Israel Brewster

unread,
Oct 26, 2021, 1:08:31 PM10/26/21
to pyqtgraph
On Oct 26, 2021, at 8:17 AM, Ognyan Moore <ognyan...@gmail.com> wrote:

Hi Israel, 

We had another issue come in that might be related


For the "fun" of it, can you comment out the update method in ViewBox.py?

Yeah, that didn’t appear to make a difference in behavior.

Depending on how easy it is to apply your patches to pyqtgraph within your example, could you try running a git-bisect from the master branch and see if you can zero in on the first problematic commit?

Yep. As mentioned in my previous e-mail, it appears to be somewhere between .1 and .2, but I’ll work on narrowing it down!

Israel Brewster

unread,
Oct 26, 2021, 2:47:17 PM10/26/21
to pyqtgraph
On Oct 26, 2021, at 8:17 AM, Ognyan Moore <ognyan...@gmail.com> wrote:

Hi Israel, 
Depending on how easy it is to apply your patches to pyqtgraph within your example, could you try running a git-bisect from the master branch and see if you can zero in on the first problematic commit?

Ok, that proved…interesting.

Up to and including commit 3a3d05b1, all looks fine.
Starting with the next commit - 61f067bf - horizontal zoom dies completely - using the scroll wheel results in only the vertical axis zooming in or out (unless the mouse is over the horizontal axis).
This is fixed at commit 775f1d62, but with the grid now being an issue, causing the zoom to see the mouse at a different x position than expected.

So perhaps commit 61f067bf introduced both issues (no horizontal zoom and the x offset of the zoom location), and commit 775f1d62 only fixed one of them? Maybe?

Ognyan Moore

unread,
Oct 26, 2021, 3:44:47 PM10/26/21
to pyqt...@googlegroups.com
Oh, git bisect when the issue is fixed/broken multiple times over is so much ...."fun"

I would have thought that https://github.com/pyqtgraph/pyqtgraph/pull/2034 would fix the issue you're having (merged 5 days ago, after 0.12.3 release)... I'll try and take a closer look in the next few days.  If you're dealing with axis and mouse related mapping issues, I would look for errenous use cases of `event.pos()` (where you should use event.scenePos()) or things of that nature.  Quite possible that one of the use-cases got missed someplace.

Israel Brewster

unread,
Feb 7, 2022, 12:45:04 PM2/7/22
to pyqtgraph
Just wanted to bump this issue. Was a fix ever figured out/implemented? I’m still running 0.12.3 at the moment, which still has this issue. Should I try updating to the latest development release?

Thanks!

---
Israel Brewster
Software Engineer
Alaska Volcano Observatory 
Geophysical Institute - UAF 
2156 Koyukuk Drive 
Fairbanks AK 99775-7320

Israel Brewster

unread,
Feb 7, 2022, 1:14:07 PM2/7/22
to pyqtgraph
Scratch the last. I just tried the latest master branch, and it works correctly, so apparently this issue *has* been addressed.

As such, the question then becomes “should I expect a new release with this fix soon, or should I just move forward with using the latest development version?”

Thanks again!

---
Israel Brewster
Software Engineer
Alaska Volcano Observatory 
Geophysical Institute - UAF 
2156 Koyukuk Drive 
Fairbanks AK 99775-7320

Ognyan Moore

unread,
Feb 7, 2022, 2:16:26 PM2/7/22
to pyqt...@googlegroups.com
Hi Israel, as you saw it's already been fixed in master; and the fix will be part of the next release, which has been pushed way further back than I had initially anticipated.  I'm trying to get one large-ish PR merged (it's still having some issues), and decided to hold off on the release until that happens.  I've had some non-pyqtgraph related events occur in sequence here that have kept me from working on the library with any regularity...but that should be easing up soon.

Sorry for the delay!


Reply all
Reply to author
Forward
0 new messages