summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-05-20 01:26:15 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-05-20 01:26:15 (GMT)
commit34bcce7616b2e2b8fae05174ca881bbbb0bc8b79 (patch)
tree991b55af9f8529aca6b2cad652896aa72db9e254
parent7f872ea70d357788bbda18f28d4765d5c3a1510e (diff)
downloadQt-34bcce7616b2e2b8fae05174ca881bbbb0bc8b79.zip
Qt-34bcce7616b2e2b8fae05174ca881bbbb0bc8b79.tar.gz
Qt-34bcce7616b2e2b8fae05174ca881bbbb0bc8b79.tar.bz2
Fix width=0 pens without radius.
-rw-r--r--src/declarative/fx/qfxrect.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/declarative/fx/qfxrect.cpp b/src/declarative/fx/qfxrect.cpp
index f1cbb58..f81f9b3 100644
--- a/src/declarative/fx/qfxrect.cpp
+++ b/src/declarative/fx/qfxrect.cpp
@@ -55,7 +55,7 @@ QML_DEFINE_TYPE(QFxPen,Pen);
By default, the pen is invalid and nothing is drawn. You must either set a color (then the default
width is 0) or a width (then the default color is black).
- A width of 0 is a single-pixel line on the border of the item being painted.
+ A width of 0 indicates a cosmetic pen, a single-pixel line on the border of the item being painted.
Example:
\qml
@@ -401,7 +401,7 @@ void QFxRect::generateRoundedRect()
Q_D(QFxRect);
if (d->_rectImage.isNull()) {
const int pw = d->_pen && d->_pen->isValid() ? d->_pen->width() : 0;
- d->_rectImage = QImage(d->_radius*2 + 1 + pw*2, d->_radius*2 + 1 + pw*2, QImage::Format_ARGB32_Premultiplied);
+ d->_rectImage = QImage(d->_radius*2 + 3 + pw*2, d->_radius*2 + 3 + pw*2, QImage::Format_ARGB32_Premultiplied);
d->_rectImage.fill(0);
QPainter p(&(d->_rectImage));
p.setRenderHint(QPainter::Antialiasing);
@@ -421,7 +421,7 @@ void QFxRect::generateBorderedRect()
Q_D(QFxRect);
if (d->_rectImage.isNull()) {
const int pw = d->_pen && d->_pen->isValid() ? d->_pen->width() : 0;
- d->_rectImage = QImage(d->pen()->width()*2 + 1 + pw*2, d->pen()->width()*2 + 1 + pw*2, QImage::Format_ARGB32_Premultiplied);
+ d->_rectImage = QImage(d->pen()->width()*2 + 3 + pw*2, d->pen()->width()*2 + 3 + pw*2, QImage::Format_ARGB32_Premultiplied);
d->_rectImage.fill(0);
QPainter p(&(d->_rectImage));
p.setRenderHint(QPainter::Antialiasing);
@@ -533,10 +533,10 @@ void QFxRect::drawRect(QPainter &p)
if (d->_radius > 0) {
generateRoundedRect();
//### implicit conversion to int
- offset = int(d->_radius+0.5+pw);
+ offset = int(d->_radius+1.5+pw);
} else {
generateBorderedRect();
- offset = pw;
+ offset = pw+1;
}
//basically same code as QFxImage uses to paint sci images