FIX: MultiAxisViewBox resizing breaks in certain cases #1070
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
As a follow up to #1069 there are cases in which depending on how the user initializes their plot the main view box on it can get stuck in a loop in which it will continue increasing in size. As a fun example try running
pydm/examples/scatterplot/scatterplot.ui
using pyqtgraph 0.13.4 without this fixThis is due to pyqtgraph/pyqtgraph#2762
The bounding rect of a ViewBox now adjusts itself before returning, so connecting the
sigResized
signal of a ViewBox to a function which changes its own size results in an endless loop of it resizing itself.There are more robust ways to solve this on our end, but this is the most fragile area of our code base which I hope to eventually replace with a built-in pyqtgraph solution to multi-axis plots if one of the PRs there gets merged. So for now the simplest seems best.
Testing
Verified that all example plots work correctly with both pyqtgraph 0.13.3 and 0.13.4.