Kaydet (Commit) c33d96aa authored tarafından peilin's avatar peilin Kaydeden (comit) Markus Mohrhard

modify SetBackGroundColor to fix background color and gradients issue

Change-Id: Ie2ffa39f6aad8df127e99109618a64fb0d32599e
üst 6820dec8
...@@ -720,10 +720,11 @@ void DummyRectangle::render() ...@@ -720,10 +720,11 @@ void DummyRectangle::render()
} }
bool bFill = true; bool bFill = true;
drawing::FillStyle eStyle = drawing::FillStyle_NONE;
itr = maProperties.find("FillStyle"); itr = maProperties.find("FillStyle");
if(itr != maProperties.end()) if(itr != maProperties.end())
{ {
drawing::FillStyle eStyle = itr->second.get<drawing::FillStyle>(); eStyle = itr->second.get<drawing::FillStyle>();
if(eStyle == drawing::FillStyle_NONE) if(eStyle == drawing::FillStyle_NONE)
{ {
bFill = false; bFill = false;
...@@ -735,15 +736,8 @@ void DummyRectangle::render() ...@@ -735,15 +736,8 @@ void DummyRectangle::render()
{ {
uno::Any co = itr->second; uno::Any co = itr->second;
sal_Int32 nColorValue = co.get<sal_Int32>(); sal_Int32 nColorValue = co.get<sal_Int32>();
//here FillStyle works for background color and gradients
itr = maProperties.find("FillTransparence"); pChart->m_GLRender.SetBackGroundColor(nColorValue, nColorValue, eStyle);
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);
} }
bool bBorder = true; bool bBorder = true;
......
...@@ -1304,7 +1304,7 @@ int OpenGLRender::RenderArea2DShape() ...@@ -1304,7 +1304,7 @@ int OpenGLRender::RenderArea2DShape()
return 0; 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 r = (color1 & 0x00FF0000) >> 16;
sal_uInt8 g = (color1 & 0x0000FF00) >> 8; sal_uInt8 g = (color1 & 0x0000FF00) >> 8;
...@@ -1313,12 +1313,12 @@ void OpenGLRender::SetBackGroundColor(sal_uInt32 color1, sal_uInt32 color2, sal_ ...@@ -1313,12 +1313,12 @@ void OpenGLRender::SetBackGroundColor(sal_uInt32 color1, sal_uInt32 color2, sal_
m_BackgroundColor[0] = (float)r / 255.0f; m_BackgroundColor[0] = (float)r / 255.0f;
m_BackgroundColor[1] = (float)g / 255.0f; m_BackgroundColor[1] = (float)g / 255.0f;
m_BackgroundColor[2] = (float)b / 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[4] = (float)r / 255.0f;
m_BackgroundColor[5] = (float)g / 255.0f; m_BackgroundColor[5] = (float)g / 255.0f;
m_BackgroundColor[6] = (float)b / 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; r = (color2 & 0x00FF0000) >> 16;
g = (color2 & 0x0000FF00) >> 8; g = (color2 & 0x0000FF00) >> 8;
...@@ -1327,12 +1327,12 @@ void OpenGLRender::SetBackGroundColor(sal_uInt32 color1, sal_uInt32 color2, sal_ ...@@ -1327,12 +1327,12 @@ void OpenGLRender::SetBackGroundColor(sal_uInt32 color1, sal_uInt32 color2, sal_
m_BackgroundColor[8] = (float)r / 255.0f; m_BackgroundColor[8] = (float)r / 255.0f;
m_BackgroundColor[9] = (float)g / 255.0f; m_BackgroundColor[9] = (float)g / 255.0f;
m_BackgroundColor[10] = (float)b / 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[12] = (float)r / 255.0f;
m_BackgroundColor[13] = (float)g / 255.0f; m_BackgroundColor[13] = (float)g / 255.0f;
m_BackgroundColor[14] = (float)b / 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); SAL_INFO("chart2.opengl", "color1 = " << color1 << ", color2 = " << color2);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment