aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/items/qsgninepatchnode.cpp
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2011-04-28 15:10:32 +0200
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2011-04-29 16:31:44 +0200
commitf0b1edca6368701237d83090a75ac61c1c6f2532 (patch)
tree99679cd30fe5815393e8306dcd553776d7a5ccb3 /src/declarative/items/qsgninepatchnode.cpp
parenta7a4c75918f6d1f8b2fc3e5e4e2f935690516451 (diff)
Revert "Flipped texture coordinates right way up."
This reverts commit ffb6fe57ee0ece18b6778889f7602811ab4ca822. Conflicts: src/declarative/scenegraph/qsgdefaultimagenode.cpp
Diffstat (limited to 'src/declarative/items/qsgninepatchnode.cpp')
-rw-r--r--src/declarative/items/qsgninepatchnode.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/declarative/items/qsgninepatchnode.cpp b/src/declarative/items/qsgninepatchnode.cpp
index 7858e98190..045dd6c94f 100644
--- a/src/declarative/items/qsgninepatchnode.cpp
+++ b/src/declarative/items/qsgninepatchnode.cpp
@@ -147,7 +147,8 @@ void QSGNinePatchNode::update()
xChunkSize = xTexSize;
} else if (m_horizontalTileMode == QSGBorderImage::Round) {
xChunkCount = qCeil(xSize / xTexSize);
- xChunkSize = xSize / xChunkCount;
+ qreal fullWidth = xChunkCount * xTexSize;
+ xChunkSize = xTexSize * xSize / fullWidth;
} else {
xChunkCount = 1;
xChunkSize = xSize;
@@ -163,7 +164,8 @@ void QSGNinePatchNode::update()
yChunkSize = yTexSize;
} else if (m_verticalTileMode == QSGBorderImage::Round) {
yChunkCount = qCeil(ySize / yTexSize);
- yChunkSize = ySize / yChunkCount;
+ qreal fullHeight = yChunkCount * yTexSize;
+ yChunkSize = yTexSize * ySize / fullHeight;
} else {
yChunkCount = 1;
yChunkSize = ySize;
@@ -184,10 +186,10 @@ void QSGNinePatchNode::update()
// Fill in the vertices.. The loop below is pretty much an exact replica
// of the one inside fillRow.
- float yTexChunk1 = 1 - m_innerRect.top() / th;
- float yTexChunk2 = 1 - m_innerRect.bottom() / th;
+ float yTexChunk1 = m_innerRect.top() / th;
+ float yTexChunk2 = m_innerRect.bottom() / th;
- fillRow(v, 0, 1, xChunkCount, xChunkSize);
+ fillRow(v, 0, 0, xChunkCount, xChunkSize);
fillRow(v, m_innerRect.y(), yTexChunk1, xChunkCount, xChunkSize);
for (int yc=0; yc<yChunkCount; ++yc) {
@@ -206,7 +208,7 @@ void QSGNinePatchNode::update()
}
fillRow(v, m_targetRect.height() - bottomBorder, yTexChunk2, xChunkCount, xChunkSize);
- fillRow(v, m_targetRect.height(), 0, xChunkCount, xChunkSize);
+ fillRow(v, m_targetRect.height(), 1, xChunkCount, xChunkSize);
// v = m_geometry.vertexDataAsTexturedPoint2D();