diff options
author | Gunnar Sletta <gunnar@trolltech.com> | 2009-11-03 13:08:00 (GMT) |
---|---|---|
committer | Gunnar Sletta <gunnar@trolltech.com> | 2009-11-03 13:08:00 (GMT) |
commit | 7b7c804723f1bbd71d436ab12f5e68a0f87c71d7 (patch) | |
tree | d8ce8756eddbb49e0947253be7c540714ed8aa42 /src/gui | |
parent | 4d0735b98a9bd6b440adf63725e6062b601ed442 (diff) | |
parent | 0a24f29a0f53716f9c9e000f5bb55ac5d925df5c (diff) | |
download | Qt-7b7c804723f1bbd71d436ab12f5e68a0f87c71d7.zip Qt-7b7c804723f1bbd71d436ab12f5e68a0f87c71d7.tar.gz Qt-7b7c804723f1bbd71d436ab12f5e68a0f87c71d7.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt-graphics-team into 4.6
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/image/qpixmap_mac.cpp | 12 | ||||
-rw-r--r-- | src/gui/painting/qpainter.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qpainterpath_p.h | 9 |
3 files changed, 13 insertions, 10 deletions
diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp index 15350e8..9209d45 100644 --- a/src/gui/image/qpixmap_mac.cpp +++ b/src/gui/image/qpixmap_mac.cpp @@ -305,11 +305,15 @@ void QMacPixmapData::fromImage(const QImage &img, } break; } - case QImage::Format_Indexed8: - for (int x = 0; x < w; ++x) { - *(drow+x) = PREMUL(image.color(*(srow + x))); + case QImage::Format_Indexed8: { + int numColors = image.numColors(); + if (numColors > 0) { + for (int x = 0; x < w; ++x) { + int index = *(srow + x); + *(drow+x) = PREMUL(image.color(qMin(index, numColors))); + } } - break; + } break; case QImage::Format_RGB32: for (int x = 0; x < w; ++x) *(drow+x) = *(((quint32*)srow) + x) | 0xFF000000; diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index cbae5b6..09a4563 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -7604,7 +7604,7 @@ start_lengthVariant: l.setPosition(QPointF(0., height)); height += l.height(); width = qMax(width, l.naturalTextWidth()); - if (!brect && height >= r.height()) + if (!dontclip && !brect && height >= r.height()) break; } textLayout.endLayout(); diff --git a/src/gui/painting/qpainterpath_p.h b/src/gui/painting/qpainterpath_p.h index 112c2bd..54b9392 100644 --- a/src/gui/painting/qpainterpath_p.h +++ b/src/gui/painting/qpainterpath_p.h @@ -132,10 +132,9 @@ public: QPainterPathData() : cStart(0), fillRule(Qt::OddEvenFill), - pathConverter(0), dirtyBounds(false), - dirtyControlBounds(false) - + dirtyControlBounds(false), + pathConverter(0) { ref = 1; require_moveTo = false; @@ -146,10 +145,10 @@ public: QPainterPathPrivate(), cStart(other.cStart), fillRule(other.fillRule), bounds(other.bounds), controlBounds(other.controlBounds), - pathConverter(0), dirtyBounds(other.dirtyBounds), dirtyControlBounds(other.dirtyControlBounds), - convex(other.convex) + convex(other.convex), + pathConverter(0) { ref = 1; require_moveTo = false; |