Fixes: assert in QPainter::fillRect on very large paint devices

For devices taller than 32768, fillRect with linear gradient would
go below the cliprect.

Task-number: QTBUG-26766
Change-Id: I516ede1545909e9ce2de5812c61bb473f99f5759
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
This commit is contained in:
aavit 2013-03-12 12:47:55 +01:00 committed by The Qt Project
parent 1e97a1ad8c
commit db775741ed

View File

@ -891,6 +891,8 @@ void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width,
const Q16Dot16 rowHeight = qMin(yFP + Q16Dot16Factor, yPb)
- qMax(yFP, yPa);
const int y = Q16Dot16ToInt(yFP);
if (y > d->clipRect.bottom())
break;
for (int i = 0; i < n; ++i) {
buffer.addSpan(x[i], len[i], y,
Q16Dot16ToInt(Q16Dot16Multiply(rowHeight, coverage[i])));