diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-11-03 18:11:01 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-11-03 18:11:01 +0100 |
commit | 4c30eb7a067b5a8dfe04689d37ff6a775acaf10a (patch) | |
tree | 4dbf1a9ab06421f8cb9be95968f56962f79be70b | |
parent | 093d54326f94467bc1601c14a38454efcc888017 (diff) |
Zero font width means non-scaled
...so make sure to always round small width of a scaled font to one, not zero.
Change-Id: I032b28e7f7183770db134f5891393ceaf39e0103
-rw-r--r-- | drawinglayer/source/primitive2d/textlayoutdevice.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx index df8617c409c4..12e83f6baf09 100644 --- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx +++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <algorithm> + #include <drawinglayer/primitive2d/textlayoutdevice.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/scoped_disposing_ptr.hxx> @@ -394,7 +398,7 @@ namespace drawinglayer vcl::Font aRetval( rFontAttribute.getFamilyName(), rFontAttribute.getStyleName(), - Size(bFontIsScaled ? nWidth : 0, nHeight)); + Size(bFontIsScaled ? std::max<sal_uInt32>(nWidth, 1) : 0, nHeight)); #endif // define various other FontAttribute aRetval.SetAlign(ALIGN_BASELINE); |