[Libreoffice-commits] core.git: 2 commits - chart2/source
Markus Mohrhard
markus.mohrhard at collabora.co.uk
Wed May 21 07:10:27 PDT 2014
chart2/source/view/main/3DChartObjects.cxx | 8 ++++++--
chart2/source/view/main/GL3DRenderer.cxx | 1 -
2 files changed, 6 insertions(+), 3 deletions(-)
New commits:
commit 31e32d3624971ba7dc9e17b7c78effd6c3c59ffa
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Wed May 21 16:04:43 2014 +0200
remove debug output
Change-Id: Ib77911177ec4d2f5b1f7c7ff75db30b6104f0682
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index d248016..e26cafe 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -1602,7 +1602,6 @@ sal_uInt32 OpenGL3DRenderer::GetPixelColorFromPoint(long nX, long nY)
glReadPixels(nX, nY, 1, 1, GL_BGRA, GL_UNSIGNED_BYTE, buf.get());
Color aColor(buf[3], buf[2], buf[1], buf[0]);
static sal_Int32 i = 0;
- OUString aFileName = OUString("/home/moggi/Documents/work/shader") + OUString::number(i) + ".png";
OpenGLHelper::renderToFile(m_iWidth, m_iHeight, aFileName);
return aColor.GetColor();
}
commit 6fd54c8e34de3a24604be428fc68ea255167a88c
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Wed May 21 16:03:59 2014 +0200
improve the text rendering a little bit more
Change-Id: I7662b77df94c439678d17fe31e611272d1802981
diff --git a/chart2/source/view/main/3DChartObjects.cxx b/chart2/source/view/main/3DChartObjects.cxx
index 6edb68f..d9c0724 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()
More information about the Libreoffice-commits
mailing list