diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-05-21 16:03:59 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-05-21 16:05:14 +0200 |
commit | 6fd54c8e34de3a24604be428fc68ea255167a88c (patch) | |
tree | bc72682f629a56d5b371e70edf2529195e62f2b9 | |
parent | 6e38357d5d8aee5204f8671ec7f363d769b4329c (diff) |
improve the text rendering a little bit more
Change-Id: I7662b77df94c439678d17fe31e611272d1802981
-rw-r--r-- | chart2/source/view/main/3DChartObjects.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/chart2/source/view/main/3DChartObjects.cxx b/chart2/source/view/main/3DChartObjects.cxx index 6edb68f3fc13..d9c0724809eb 100644 --- a/chart2/source/view/main/3DChartObjects.cxx +++ b/chart2/source/view/main/3DChartObjects.cxx @@ -75,13 +75,17 @@ Text::Text(OpenGL3DRenderer* pRenderer, const OUString& rStr, sal_uInt32 nId): Font aFont = aDevice.GetFont(); aFont.SetSize(Size(0, 96)); aFont.SetColor(COL_BLACK); + ::Rectangle aRect; aDevice.SetFont(aFont); aDevice.Erase(); - aDevice.SetOutputSizePixel(Size(160,96)); + aDevice.GetTextBoundRect(aRect, rStr); + Size aSize = aRect.GetSize(); + aSize.Height() *= 2; + aDevice.SetOutputSizePixel(aSize); aDevice.SetBackground(Wallpaper(COL_TRANSPARENT)); aDevice.DrawText(Point(0,0), rStr); - maText = BitmapEx(aDevice.GetBitmapEx(Point(0,0), Size(160,96))); + maText = BitmapEx(aDevice.GetBitmapEx(Point(0,0), aSize)); } void Text::render() |