From 98023c7eba3205b85b2ad0c107ce72072a2b0bba Mon Sep 17 00:00:00 2001
From: Frederik Gladhorn <frederik.gladhorn@digia.com>
Date: Tue, 30 Apr 2013 15:06:40 +0200
Subject: [PATCH] Canvas: Do not apply transform to text twice
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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>
---
 examples/quick/canvas/quadraticCurveTo/quadraticCurveTo.qml | 5 ++---
 src/quick/items/context2d/qquickcontext2d.cpp               | 1 -
 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;
 }
 
-- 
GitLab