Open feketeimre opened 6 years ago
Turns out its a "bug" in Qt. Probably due to loss of precision when mapping with a QTransform having large scale values.
To reproduce a similar problem in Qt, zoom in really far, the red rectangle will disappear suddenly:
from pyqtgraph.Qt import QtGui,QtCore
import sys
class QGraphicsView(QtGui.QGraphicsView):
def __init__(self, parent=None):
super(QGraphicsView, self).__init__(parent)
def wheelEvent(self, ev):
if ev.delta()>0: self.scale(1.5, 1.5)
elif ev.delta()<0: self.scale(0.5, 0.5)
app = QtGui.QApplication(sys.argv)
gw = QGraphicsView()
scene = QtGui.QGraphicsScene()
gw.setScene(scene)
rect = QtGui.QGraphicsRectItem(-10,-10,20,20)
rect.setBrush(QtGui.QBrush(QtGui.QColor(255,0,0,64)))
scene.addItem(rect)
gw.show()
sys.exit(app.exec_())
This might be related to the Qt coordinate mapping transforms that seem to be unrelaible for extreme values. There is more discussion on that in #1537.
I was hoping #1557 could fix this, but it didn't...there is also some secondary issue with values being too high (error when the exponential value is 20+ no error when the exponential value is 19).
This might be the example I need to replicate potential issues that #1557 is meant to solve.
When ImageView is used with an array containing large values the HistogramLUTWidget becomes slightly bugged. The LinearRegionItem cannot be hovered, selected or dragged, only panning and zoom works on the Axis Item. When zoomed in far the axis starts to behave strange too, the ticks get misaligned. The LinearRegionItem hover highlight is off too.
I reproduced the same problems on 32bit Python but it looked fine on 64bit. The issues with zooming still exits on both. Considering this it feels like it has something to do with either numpy or Qt. I have attached an image how it looks for me, there should be a histogram on the picture also, for some reason it wont display either:![imageviewbug](https://user-images.githubusercontent.com/15861028/31186058-e7e39f3e-a92d-11e7-87a4-dd259f51d892.png)
You can reproduce the above with the following code: