pdfviewer: fix font rotation issues
Review URL: https://codereview.chromium.org/22407005
git-svn-id: http://skia.googlecode.com/svn/trunk@10617 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/experimental/PdfViewer/SkPdfFont.h b/experimental/PdfViewer/SkPdfFont.h
index d5641b2..bbbaa7a 100644
--- a/experimental/PdfViewer/SkPdfFont.h
+++ b/experimental/PdfViewer/SkPdfFont.h
@@ -172,9 +172,14 @@
void drawText(const SkDecodedText& text, SkPaint* paint, PdfContext* pdfContext, SkCanvas* canvas) {
for (int i = 0 ; i < text.size(); i++) {
+ canvas->setMatrix(pdfContext->fGraphicsState.fMatrixTm);
+#ifdef PDF_TRACE
+ SkPoint point = SkPoint::Make(SkDoubleToScalar(0), SkDoubleToScalar(0));
+ pdfContext->fGraphicsState.fMatrixTm.mapPoints(&point, 1);
+ printf("DrawText at (%f, %f)\n", SkScalarToDouble(point.x()), SkScalarToDouble(point.y()));
+#endif // PDF_TRACE
double width = drawOneChar(text[i], paint, pdfContext, canvas);
pdfContext->fGraphicsState.fMatrixTm.preTranslate(SkDoubleToScalar(width), SkDoubleToScalar(0.0));
- canvas->translate(SkDoubleToScalar(width), SkDoubleToScalar(0.0));
}
}