diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-12-21 21:21:20 +0000 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-01-12 16:15:44 +0000 |
commit | cfaf07f88332dfe0476d559787c508a1688b5956 (patch) | |
tree | 58783a979ba334eee8589ef754141ac2e8284832 | |
parent | 9ddedaad4cb5e2b3e54ea40871baaf799a44e350 (diff) |
Resolves: tdf#93703 0 scaling is CAIRO_STATUS_INVALID_MATRIX
so more drawing to the surface fails
prior to 4ac876084bb89b6460b31e090a666b395f66b1e8 we had
a new cairo context each time to the error was thrown away
along with the context and the new one would work
Change-Id: I90ab1a943e8908e87f391bdfb8ccd5f3818e13d5
(cherry picked from commit f22d153a07231f2d41c7be9ba0e6b7ce963a0762)
Reviewed-on: https://gerrit.libreoffice.org/20852
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r-- | canvas/source/cairo/cairo_textlayout.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx index 03d319473e7c..414c29d2525b 100644 --- a/canvas/source/cairo/cairo_textlayout.cxx +++ b/canvas/source/cairo/cairo_textlayout.cxx @@ -497,6 +497,14 @@ namespace cairocanvas if (cairo_glyphs.empty()) continue; + vcl::Font aFont = rOutDev.GetFont(); + long nWidth = aFont.GetWidth(); + long nHeight = aFont.GetHeight(); + if (nWidth == 0) + nWidth = nHeight; + if (nWidth == 0 || nHeight == 0) + continue; + /** * Setup font **/ @@ -548,17 +556,12 @@ namespace cairocanvas // Font rotation and scaling cairo_matrix_t m; - vcl::Font aFont = rOutDev.GetFont(); cairo_matrix_init_identity(&m); if (aSysLayoutData.orientation) cairo_matrix_rotate(&m, (3600 - aSysLayoutData.orientation) * M_PI / 1800.0); - long nWidth = aFont.GetWidth(); - long nHeight = aFont.GetHeight(); - if (nWidth == 0) - nWidth = nHeight; cairo_matrix_scale(&m, nWidth, nHeight); //faux italics |