Kaydet (Commit) 14e1af63 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

paint gradients in data bars

Change-Id: I2b5488296d3ca8aee92f7999bd4d82a9c9eada88
üst 9804981f
......@@ -657,6 +657,8 @@ ScDataBarInfo* ScDataBarFormat::GetDataBarInfo(const ScAddress& rAddr) const
else
pInfo->maColor = mpFormatData->maPositiveColor;
pInfo->mbGradient = mpFormatData->mbGradient;
return pInfo;
}
......
......@@ -50,6 +50,7 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <svx/sdr/contact/objectcontacttools.hxx>
#include <vcl/lineinfo.hxx>
#include <vcl/gradient.hxx>
#include <svx/unoapi.hxx>
#include "output.hxx"
......@@ -830,9 +831,25 @@ void drawDataBars( const ScDataBarInfo* pOldDataBarInfo, OutputDevice* pDev, con
else
return;
//TODO: improve this for gradient fill
pDev->SetFillColor(pOldDataBarInfo->maColor);
pDev->DrawRect(aPaintRect);
if(pOldDataBarInfo->mbGradient)
{
pDev->SetLineColor(pOldDataBarInfo->maColor);
Gradient aGradient(GRADIENT_LINEAR, pOldDataBarInfo->maColor, COL_TRANSPARENT);
if(pOldDataBarInfo->mnLength < 0)
aGradient.SetAngle(2700);
else
aGradient.SetAngle(900);
pDev->DrawGradient(aPaintRect, aGradient);
pDev->SetLineColor();
}
else
{
pDev->SetFillColor(pOldDataBarInfo->maColor);
pDev->DrawRect(aPaintRect);
}
//draw axis
if(pOldDataBarInfo->mnZero)
......
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