Skip to content

Commit 04211ed

Browse files
author
Pierre Raybaut
committed
Fixed: QwtPixelMatrix was not used in qwt/point_mapper
1 parent 2232d9f commit 04211ed

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

qwt/point_mapper.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,17 @@ def qwtToPolylineFilteredF(xMap, yMap, series, from_, to, round_):
103103
def qwtToPointsFiltered(boundingRect, xMap, yMap, series, from_, to,
104104
Polygon):
105105
Point = QPointF if isinstance(Polygon, QPolygonF) else QPoint
106+
if isinstance(boundingRect, QRectF):
107+
pixelMatrix = QwtPixelMatrix(boundingRect.toAlignedRect())
108+
else:
109+
pixelMatrix = QwtPixelMatrix(boundingRect)
106110
points = []
107111
for i in range(from_, to+1):
108112
sample = series.sample(i)
109113
x = int(round(xMap.transform(sample.x())))
110114
y = int(round(yMap.transform(sample.y())))
111-
points.append(Point(x, y))
115+
if pixelMatrix.testAndSetPixel(x, y, True) == False:
116+
points.append(Point(x, y))
112117
return Polygon(list(set(points)))
113118

114119
def qwtToPointsFilteredI(boundingRect, xMap, yMap, series, from_, to):

0 commit comments

Comments
 (0)