[Libreoffice-commits] core.git: Branch 'feature/chart-3d-chart2' - 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 5b9a2e6503995b1776fe1ae4ec5a0d62f7a2243a
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 99d569c0e2ac4c2f3e5e97f78daf60f83d96fdad
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