reverse coordinates when drawing on row-major images#2085
reverse coordinates when drawing on row-major images#2085j9ac9k merged 1 commit intopyqtgraph:masterfrom
Conversation
|
|
||
| def drawAt(self, pos, ev=None): | ||
| pos = [int(pos.x()), int(pos.y())] | ||
| if self.axisOrder == "col-major": |
There was a problem hiding this comment.
change looks fine to me, but do you know if there is a situation where it would be preferable to do
point = pos.toPoint()
[point.x(), point.y()]Or the better way of phrasing that question is is there a situation where QPointF -> QPoint conversion is what we would want instead of int(QPointF.x()) ?
clearly this has worked well for us in the library, so not requesting a change, just something that crossed my mind when I looked at this.
There was a problem hiding this comment.
Ooo, interesting. The documentation at https://doc.qt.io/qt-5/qpointf.html#toPoint says it would round the values, whereas int is going to floor them. Rounding is better, but investigating, I also found problems. To be continued...
|
This also fixes #784 |
|
Thanks @outofculture Love it when the "simple" fix does the trick. |
This addresses #2071