diff options
author | Andy Nichols <andy.nichols@digia.com> | 2014-09-10 15:56:49 +0200 |
---|---|---|
committer | Andy Nichols <andy.nichols@digia.com> | 2014-09-11 15:41:12 +0300 |
commit | 699dbb8914e718013d9ee0cbb39bdb4b6f833710 (patch) | |
tree | 1aa5054a6f632c512a828d5bbfd7186f69d3ff1d /src/plugins/scenegraph/softwarecontext/ninepatchnode.cpp | |
parent | 5b7047618323a9be74169f5a0bbac35b429567e7 (diff) |
Ensure that markDirty is called when needed
There were many cases where properties of nodes could change but since
the node was not marked dirty, the scene update was never rendered.
Change-Id: I7740a43d98521073056f85fe80d6c1ff213236a3
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Diffstat (limited to 'src/plugins/scenegraph/softwarecontext/ninepatchnode.cpp')
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/ninepatchnode.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/scenegraph/softwarecontext/ninepatchnode.cpp b/src/plugins/scenegraph/softwarecontext/ninepatchnode.cpp index ab503b7af5..ec77729388 100644 --- a/src/plugins/scenegraph/softwarecontext/ninepatchnode.cpp +++ b/src/plugins/scenegraph/softwarecontext/ninepatchnode.cpp @@ -35,21 +35,35 @@ void NinePatchNode::setTexture(QSGTexture *texture) return; } m_pixmap = pt->pixmap(); + markDirty(DirtyMaterial); } void NinePatchNode::setBounds(const QRectF &bounds) { + if (m_bounds == bounds) + return; + m_bounds = bounds; + markDirty(DirtyGeometry); } void NinePatchNode::setDevicePixelRatio(qreal ratio) { + if (m_pixelRatio == ratio) + return; + m_pixelRatio = ratio; + markDirty(DirtyGeometry); } void NinePatchNode::setPadding(qreal left, qreal top, qreal right, qreal bottom) { + QMargins margins(qRound(left), qRound(top), qRound(right), qRound(bottom)); + if (m_margins == margins) + return; + m_margins = QMargins(qRound(left), qRound(top), qRound(right), qRound(bottom)); + markDirty(DirtyGeometry); } void NinePatchNode::update() |