Fix assert when drawing lines with extreme coordinates
For extreme coordinates, the rasterizer's width parameter could become NaN, which compares false with everything and hence would trigger an assert. Fixes: QTBUG-56434 Change-Id: I27abae6ab0bc94ce042be86ea0587095cdb7d487 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>bb10
parent
a2b31cd5db
commit
1e0395f73e
|
|
@ -755,11 +755,9 @@ static inline int qSafeFloatToQ16Dot16(qreal x)
|
|||
|
||||
void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, bool squareCap)
|
||||
{
|
||||
if (a == b || width == 0 || d->clipRect.isEmpty())
|
||||
if (a == b || !(width > 0.0) || d->clipRect.isEmpty())
|
||||
return;
|
||||
|
||||
Q_ASSERT(width > 0.0);
|
||||
|
||||
QPointF pa = a;
|
||||
QPointF pb = b;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue