Skip to content

Fix stuck ColorBarItem#2103

Merged
j9ac9k merged 4 commits intopyqtgraph:masterfrom
NilsNemitz:StuckColorBarItem
Nov 18, 2021
Merged

Fix stuck ColorBarItem#2103
j9ac9k merged 4 commits intopyqtgraph:masterfrom
NilsNemitz:StuckColorBarItem

Conversation

@NilsNemitz
Copy link
Copy Markdown
Contributor

@NilsNemitz NilsNemitz commented Nov 15, 2021

This address #2102:

The test case there (Thank you @pijyoi!) triggers a case I had not considered in the range adjustment code of ColorBarItem:

  • Set the (top) range and limit to a value that is slightly below a rounding step.
  • Start adjusting the bottom range

Result:
The top end of the range is detected out of range and corrected down, but restored to the original value by rounding.
This is (continuously) interpreted as both top and bottom end moving, a "region move" normally triggered by dragging the center of the bar.
In that case, the previous size of the region is held fixed to avoid squishing the range against the top or bottom limit.
Which is the bug encountered in #2102 : The region actively resists any attempt to make it smaller.

This PR

  • slightly expands the limits to make them consistent with the rounding step
  • double checks for a region move before blocking the region size.

I hope that eliminates the issue in the future and closes #2102

@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Nov 18, 2021

LGTM, thanks @NilsNemitz !

@j9ac9k j9ac9k merged commit 3d14f0f into pyqtgraph:master Nov 18, 2021
ntjess pushed a commit to ntjess/pyqtgraph that referenced this pull request Dec 10, 2021
* Fix permanent collision signal due rounding

* add additional insurance against false detection of full region move
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ColorBarItem lower axis value stuck

2 participants