aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/adaptations/software/qsgsoftwareinternalrectanglenode.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-11-30 01:00:08 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-11-30 01:00:08 +0100
commit2752a4632e94e2687655087d0d7f98b6b16e16a9 (patch)
tree3d9fe294e67cd5f5ae12a0004d467ec7b5b7bf51 /src/quick/scenegraph/adaptations/software/qsgsoftwareinternalrectanglenode.cpp
parent070eb7bdde4f9e6e814c3afc593368918fd445af (diff)
parentd0a52c72b5756787ceb6094117cd71d935badc06 (diff)
Merge remote-tracking branch 'origin/5.12' into dev
Diffstat (limited to 'src/quick/scenegraph/adaptations/software/qsgsoftwareinternalrectanglenode.cpp')
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwareinternalrectanglenode.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwareinternalrectanglenode.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwareinternalrectanglenode.cpp
index 2c361e03e2..f50fa00b0b 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwareinternalrectanglenode.cpp
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwareinternalrectanglenode.cpp
@@ -121,7 +121,7 @@ void QSGSoftwareInternalRectangleNode::setGradientStops(const QGradientStops &st
for (const QGradientStop &stop : qAsConst(stops)) {
if (stop.first < 0.0 || stop.first > 1.0) {
needsNormalization = true;
- continue;
+ break;
}
}
@@ -425,8 +425,11 @@ void QSGSoftwareInternalRectangleNode::generateCornerPixmap()
{
//Generate new corner Pixmap
int radius = qFloor(qMin(qMin(m_rect.width(), m_rect.height()) * 0.5, m_radius));
+ const auto width = qRound(radius * 2 * m_devicePixelRatio);
+
+ if (m_cornerPixmap.width() != width)
+ m_cornerPixmap = QPixmap(width, width);
- m_cornerPixmap = QPixmap(qRound(radius * 2 * m_devicePixelRatio), qRound(radius * 2 * m_devicePixelRatio));
m_cornerPixmap.setDevicePixelRatio(m_devicePixelRatio);
m_cornerPixmap.fill(Qt::transparent);