aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-04-30 15:06:40 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-03 16:27:49 +0200
commit98023c7eba3205b85b2ad0c107ce72072a2b0bba (patch)
tree0499b725eed8d95c3825991608fc3879b20c1ae6
parentee677dc8d85b36990d67e1be0e6e3187fd6b6a78 (diff)
Canvas: Do not apply transform to text twice
The path already has the transform, no need to apply it a second time manually. Task-number: QTBUG-30501 Change-Id: Iedcb2e2f85a1f9eeac8e6264e00536c43bf16ddb Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
-rw-r--r--examples/quick/canvas/quadraticCurveTo/quadraticCurveTo.qml5
-rw-r--r--src/quick/items/context2d/qquickcontext2d.cpp1
2 files changed, 2 insertions, 4 deletions
diff --git a/examples/quick/canvas/quadraticCurveTo/quadraticCurveTo.qml b/examples/quick/canvas/quadraticCurveTo/quadraticCurveTo.qml
index 0756d339ff..69e703cca7 100644
--- a/examples/quick/canvas/quadraticCurveTo/quadraticCurveTo.qml
+++ b/examples/quick/canvas/quadraticCurveTo/quadraticCurveTo.qml
@@ -116,13 +116,12 @@ Item {
if (canvas.stroke)
ctx.stroke();
- ctx.restore();
-
// ![1]
ctx.fillStyle = "white";
ctx.font = "Bold 17px";
- ctx.fillText("Qt Quick", 110, 140);
+ ctx.fillText("Qt Quick", 40, 70);
// ![1]
+ ctx.restore();
}
}
}
diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp
index b366775c03..abbe584d91 100644
--- a/src/quick/items/context2d/qquickcontext2d.cpp
+++ b/src/quick/items/context2d/qquickcontext2d.cpp
@@ -3283,7 +3283,6 @@ QPainterPath QQuickContext2D::createTextGlyphs(qreal x, qreal y, const QString&
QPainterPath textPath;
textPath.addText(x - xoffset, y - yoffset+metrics.ascent(), state.font, text);
- textPath = state.matrix.map(textPath);
return textPath;
}