summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorpeilin <peilin@multicorewareinc.com>2014-03-17 10:48:46 +0800
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-03-17 21:13:26 +0100
commitc33d96aa8bbe94761b609215951a64e380856cac (patch)
tree0bab093b7122c30e333fadb92c506e20cb034e74 /chart2
parent6820dec8903b182260340c638c35b5a5ca207a85 (diff)
modify SetBackGroundColor to fix background color and gradients issue
Change-Id: Ie2ffa39f6aad8df127e99109618a64fb0d32599e
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/view/main/DummyXShape.cxx14
-rwxr-xr-xchart2/source/view/main/OpenGLRender.cxx10
2 files changed, 9 insertions, 15 deletions
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index e0b5f21de765..bdec56519512 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -720,10 +720,11 @@ void DummyRectangle::render()
}
bool bFill = true;
+ drawing::FillStyle eStyle = drawing::FillStyle_NONE;
itr = maProperties.find("FillStyle");
if(itr != maProperties.end())
{
- drawing::FillStyle eStyle = itr->second.get<drawing::FillStyle>();
+ eStyle = itr->second.get<drawing::FillStyle>();
if(eStyle == drawing::FillStyle_NONE)
{
bFill = false;
@@ -735,15 +736,8 @@ void DummyRectangle::render()
{
uno::Any co = itr->second;
sal_Int32 nColorValue = co.get<sal_Int32>();
-
- itr = maProperties.find("FillTransparence");
- sal_uInt8 nAlpha = 255;
- if(itr != maProperties.end())
- {
- uno::Any al = itr->second;
- nAlpha = 255 - al.get<sal_Int32>()/100.0*255;
- }
- pChart->m_GLRender.SetBackGroundColor(nColorValue, nColorValue, nAlpha);
+ //here FillStyle works for background color and gradients
+ pChart->m_GLRender.SetBackGroundColor(nColorValue, nColorValue, eStyle);
}
bool bBorder = true;
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 72e0c2776553..689925a7dfd2 100755
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -1304,7 +1304,7 @@ int OpenGLRender::RenderArea2DShape()
return 0;
}
-void OpenGLRender::SetBackGroundColor(sal_uInt32 color1, sal_uInt32 color2, sal_uInt8 nAlpha)
+void OpenGLRender::SetBackGroundColor(sal_uInt32 color1, sal_uInt32 color2, sal_uInt8 fillStyle)
{
sal_uInt8 r = (color1 & 0x00FF0000) >> 16;
sal_uInt8 g = (color1 & 0x0000FF00) >> 8;
@@ -1313,12 +1313,12 @@ void OpenGLRender::SetBackGroundColor(sal_uInt32 color1, sal_uInt32 color2, sal_
m_BackgroundColor[0] = (float)r / 255.0f;
m_BackgroundColor[1] = (float)g / 255.0f;
m_BackgroundColor[2] = (float)b / 255.0f;
- m_BackgroundColor[3] = nAlpha / 255.0f;
+ m_BackgroundColor[3] = fillStyle ? 1.0 : 0.0;
m_BackgroundColor[4] = (float)r / 255.0f;
m_BackgroundColor[5] = (float)g / 255.0f;
m_BackgroundColor[6] = (float)b / 255.0f;
- m_BackgroundColor[7] = nAlpha / 255.0f;
+ m_BackgroundColor[7] = fillStyle ? 1.0 : 0.0;
r = (color2 & 0x00FF0000) >> 16;
g = (color2 & 0x0000FF00) >> 8;
@@ -1327,12 +1327,12 @@ void OpenGLRender::SetBackGroundColor(sal_uInt32 color1, sal_uInt32 color2, sal_
m_BackgroundColor[8] = (float)r / 255.0f;
m_BackgroundColor[9] = (float)g / 255.0f;
m_BackgroundColor[10] = (float)b / 255.0f;
- m_BackgroundColor[11] = nAlpha / 255.0f;
+ m_BackgroundColor[11] = fillStyle ? 1.0 : 0.0;
m_BackgroundColor[12] = (float)r / 255.0f;
m_BackgroundColor[13] = (float)g / 255.0f;
m_BackgroundColor[14] = (float)b / 255.0f;
- m_BackgroundColor[15] = nAlpha / 255.0f;
+ m_BackgroundColor[15] = fillStyle ? 1.0 : 0.0;
SAL_INFO("chart2.opengl", "color1 = " << color1 << ", color2 = " << color2);
}