[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: =?utf-8?q?=5Bkdelibs=5D_plasma=3A_the_result_image_is_bigger_due?=
From: Marco Martin <notmart () gmail ! com>
Date: 2011-02-05 16:24:09
Message-ID: 20110205162409.2FE98A609B () git ! kde ! org
[Download RAW message or body]
Git commit 51f5325f24d706d87934f0b3d41b5c6a89747861 by Marco Martin.
Committed on 05/02/11 at 16:11.
Pushed by mart into branch 'master'.
the result image is bigger due to the blur
M +6 -6 plasma/paintutils.cpp
http://commits.kde.org/kdelibs/51f5325f24d706d87934f0b3d41b5c6a89747861
diff --git a/plasma/paintutils.cpp b/plasma/paintutils.cpp
index 02db812..0859e65 100644
--- a/plasma/paintutils.cpp
+++ b/plasma/paintutils.cpp
@@ -123,13 +123,13 @@ QPixmap texturedText(const QString &text, const QFont &font, Plasma::Svg *textur
buffPainter.end();
//do the shadow
- QImage image(pixmap.size(), QImage::Format_ARGB32_Premultiplied);
+ QImage image(pixmap.size() + QSize(2, 2), QImage::Format_ARGB32_Premultiplied);
image.fill(Qt::transparent);
buffPainter.begin(&image);
buffPainter.setFont(font);
- buffPainter.drawText(contentsRect, Qt::AlignCenter, text);
+ buffPainter.drawText(contentsRect.translated(1, 1), Qt::AlignCenter, text);
buffPainter.setCompositionMode(QPainter::CompositionMode_SourceIn);
- texture->paint(&buffPainter, contentsRect, "shadow");
+ texture->paint(&buffPainter, contentsRect.adjusted(-1, -1, 1, 1), "shadow");
buffPainter.end();
expblur<16, 7>(image, 1);
@@ -137,15 +137,15 @@ QPixmap texturedText(const QString &text, const QFont &font, Plasma::Svg *textur
buffPainter.begin(&image);
buffPainter.setCompositionMode(QPainter::CompositionMode_DestinationOut);
buffPainter.setFont(font);
- buffPainter.drawText(contentsRect, Qt::AlignCenter, text);
+ buffPainter.drawText(contentsRect.translated(1, 1), Qt::AlignCenter, text);
buffPainter.end();
QPixmap ret(image.size());
ret.fill(Qt::transparent);
buffPainter.begin(&ret);
buffPainter.setCompositionMode(QPainter::CompositionMode_SourceOver);
- buffPainter.drawImage(contentsRect, image);
- buffPainter.drawPixmap(contentsRect, pixmap);
+ buffPainter.drawImage(QPoint(0,0), image);
+ buffPainter.drawPixmap(QPoint(1,1), pixmap);
return ret;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic