aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/items/qsgninepatchnode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/items/qsgninepatchnode.cpp')
-rw-r--r--src/declarative/items/qsgninepatchnode.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/declarative/items/qsgninepatchnode.cpp b/src/declarative/items/qsgninepatchnode.cpp
index 045dd6c94f..eaa97178f4 100644
--- a/src/declarative/items/qsgninepatchnode.cpp
+++ b/src/declarative/items/qsgninepatchnode.cpp
@@ -48,6 +48,7 @@ QSGNinePatchNode::QSGNinePatchNode()
, m_horizontalTileMode(QSGBorderImage::Stretch)
, m_verticalTileMode(QSGBorderImage::Stretch)
, m_dirtyGeometry(false)
+ , m_mirror(false)
{
setOpaqueMaterial(&m_material);
setMaterial(&m_materialO);
@@ -118,6 +119,15 @@ QSGTexture *QSGNinePatchNode::texture() const
return m_material.texture();
}
+void QSGNinePatchNode::setMirror(bool m)
+{
+ if (m_mirror == m)
+ return;
+ m_mirror = m;
+ m_dirtyGeometry = true;
+}
+
+
void QSGNinePatchNode::update()
{
if (!m_dirtyGeometry)
@@ -210,6 +220,13 @@ void QSGNinePatchNode::update()
fillRow(v, m_targetRect.height() - bottomBorder, yTexChunk2, xChunkCount, xChunkSize);
fillRow(v, m_targetRect.height(), 1, xChunkCount, xChunkSize);
+ if (m_mirror) {
+ v = m_geometry.vertexDataAsTexturedPoint2D();
+ for (int i=0; i<m_geometry.vertexCount(); ++i) {
+ v->x = m_targetRect.width() - v->x;
+ ++v;
+ }
+ }
// v = m_geometry.vertexDataAsTexturedPoint2D();
// for (int i=0; i<m_geometry.vertexCount(); ++i) {