summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2014-01-31 10:28:55 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-02-02 14:14:04 +0000
commitfd07d1758ee62eebfe95b157ba651de282feec0e (patch)
treeac0bcae7afea6b9bd7118924b1ea3c6cf1a471fb
parent2d0b2cb6b7ca48663d09118acfb01a1dd194a1e1 (diff)
cairo canvas: Zero font's width means "the same as height".
Change-Id: I1d24b2039fb3c615e672189d12c77e960cc858ee Reviewed-on: https://gerrit.libreoffice.org/7764 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--canvas/source/cairo/cairo_textlayout.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx
index 35defcd9080b..8924b4f9614c 100644
--- a/canvas/source/cairo/cairo_textlayout.cxx
+++ b/canvas/source/cairo/cairo_textlayout.cxx
@@ -518,7 +518,11 @@ namespace cairocanvas
if (aSysLayoutData.orientation)
cairo_matrix_rotate(&m, (3600 - aSysLayoutData.orientation) * M_PI / 1800.0);
- cairo_matrix_scale(&m, aFont.GetWidth(), aFont.GetHeight());
+ long nWidth = aFont.GetWidth();
+ long nHeight = aFont.GetHeight();
+ if (nWidth == 0)
+ nWidth = nHeight;
+ cairo_matrix_scale(&m, nWidth, nHeight);
//faux italics
if (rSysFontData.bFakeItalic)