diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2009-09-24 02:49:52 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2009-09-24 02:49:52 (GMT) |
commit | 3402f53a52d6e1a4bce2a0ff084754399c312b08 (patch) | |
tree | 94cc03fb1d96a91e0b3f550d8beac42dcb88ac31 | |
parent | 09b117a97edd0791fb2c30f7a73704c926327ba3 (diff) | |
download | Qt-3402f53a52d6e1a4bce2a0ff084754399c312b08.zip Qt-3402f53a52d6e1a4bce2a0ff084754399c312b08.tar.gz Qt-3402f53a52d6e1a4bce2a0ff084754399c312b08.tar.bz2 |
Enhance QFxPainted item to work when on non-white backgrounds.
Improved version of the fix in 1c011c7f70791e0a4a38bd9f8bb1988cd604305c
This fixes the bug with text cursors being an unusally large white rect
in the flicker demo.
-rw-r--r-- | src/declarative/fx/qfxpainteditem.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/declarative/fx/qfxpainteditem.cpp b/src/declarative/fx/qfxpainteditem.cpp index 27f3ca6..ac3de5e 100644 --- a/src/declarative/fx/qfxpainteditem.cpp +++ b/src/declarative/fx/qfxpainteditem.cpp @@ -231,9 +231,17 @@ void QFxPaintedItem::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidge QPainter qp(&d->imagecache[i]->image); qp.setRenderHints(QPainter::HighQualityAntialiasing | QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform, d->smooth); qp.translate(-area.x(), -area.y()); - qp.eraseRect(d->imagecache[i]->dirty); - if (d->fillColor.isValid()) - qp.fillRect(d->imagecache[i]->dirty,d->fillColor); + if (d->fillColor.isValid()){ + if(d->fillColor.alpha() < 255){ + // ### Might not work outside of raster paintengine + QPainter::CompositionMode prev = qp.compositionMode(); + qp.setCompositionMode(QPainter::CompositionMode_Source); + qp.fillRect(d->imagecache[i]->dirty,d->fillColor); + qp.setCompositionMode(prev); + }else{ + qp.fillRect(d->imagecache[i]->dirty,d->fillColor); + } + } qp.setClipRect(d->imagecache[i]->dirty); drawContents(&qp, d->imagecache[i]->dirty); d->imagecache[i]->dirty = QRect(); |