summaryrefslogtreecommitdiff
path: root/chart2/source
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/view/main/3DChartObjects.cxx8
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()