From 6fd54c8e34de3a24604be428fc68ea255167a88c Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Wed, 21 May 2014 16:03:59 +0200 Subject: [PATCH] improve the text rendering a little bit more Change-Id: I7662b77df94c439678d17fe31e611272d1802981 --- chart2/source/view/main/3DChartObjects.cxx | 8 ++++++-- 1 file 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()