Canvas: Do not apply transform to text twice
authorFrederik Gladhorn <frederik.gladhorn@digia.com>
Tue, 30 Apr 2013 13:06:40 +0000 (15:06 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 3 May 2013 14:27:49 +0000 (16:27 +0200)
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
src/quick/items/context2d/qquickcontext2d.cpp

index 0756d33..69e703c 100644 (file)
@@ -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();
             }
         }
     }
index b366775..abbe584 100644 (file)
@@ -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;
 }