Skip to content

Commit ae9b5c6

Browse files
committed
Fix: update canvasRect type to QRectF for improved intersection checks in CircleSVGShape
1 parent 22133e9 commit ae9b5c6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
🛠️ Bug fixes:
66

7+
* Fixed update `canvasRect` type to `QRectF` for intersection checks in `CircleSVGShape`, following [this bug fix](https://github.com/PlotPyStack/PythonQwt/commit/d0b5e26d8f78a9a65939503553f1bc1b56826e4e) in `PythonQwt` V0.14.4
8+
79
* Fixed regression with respect to `guiqwt` regarding plot items instantiation:
810
* `guiqwt` was allowing to instantiate plot items without needing to create a `QApplication` instance (no GUI event loop was required)
911
* This was not the case with `plotpy`, so that it was not possible -for example- to serialize/deserialize plot items to JSON without creating a `QApplication` instance

plotpy/items/shape/svg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ def draw(
119119
painter: QG.QPainter,
120120
xMap: QwtScaleMap,
121121
yMap: QwtScaleMap,
122-
canvasRect: QC.QRect,
122+
canvasRect: QC.QRectF,
123123
) -> None:
124124
"""Draw shape (reimplement shape.Shape.draw))"""
125125
points, line0, line1, rect = self.compute_elements(xMap, yMap)
126-
if canvasRect.intersects(rect.toRect()) and self.svg_data is not None:
126+
if canvasRect.intersects(rect) and self.svg_data is not None:
127127
pen, brush, symbol = self.get_pen_brush(xMap, yMap)
128128
painter.setRenderHint(QG.QPainter.Antialiasing)
129129
painter.setPen(pen)

0 commit comments

Comments
 (0)