[Libreoffice-commits] core.git: Branch 'feature/chart-opengl2' - 2 commits - chart2/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Sat Jan 4 05:16:53 PST 2014
chart2/source/view/charttypes/BubbleChart.cxx | 7 +++++++
chart2/source/view/main/VDataSeries.cxx | 12 ++++++++++++
2 files changed, 19 insertions(+)
New commits:
commit 06d25e66d43dc23c1de096e077c912e3b7fd892e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sat Jan 4 16:14:51 2014 +0100
improve the color interpolation in time based charts
Change-Id: I732cee263258939742b7c43e02e89053a5dce9a8
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index efc5333..2ebe5f5 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -1106,6 +1106,18 @@ double VDataSeries::getValueByProperty( sal_Int32 nIndex, const OUString& rPropN
if(mpOldSeries && mpOldSeries->hasPropertyMapping(rPropName))
{
double fOldValue = mpOldSeries->getValueByProperty( nIndex, rPropName );
+ if(rPropName.endsWith("Color"))
+ {
+ //optimized interpolation for color values
+ Color aColor(static_cast<sal_uInt32>(fValue));
+ Color aOldColor(static_cast<sal_uInt32>(fOldValue));
+ sal_uInt8 r = aOldColor.GetRed() + (aColor.GetRed() - aOldColor.GetRed()) * mnPercent;
+ sal_uInt8 g = aOldColor.GetGreen() + (aColor.GetGreen() - aOldColor.GetGreen()) * mnPercent;
+ sal_uInt8 b = aOldColor.GetBlue() + (aColor.GetBlue() - aOldColor.GetBlue()) * mnPercent;
+ sal_uInt8 t = aOldColor.GetTransparency() + (aColor.GetTransparency() - aOldColor.GetTransparency()) * mnPercent;
+ Color aRet(t, r, g, b);
+ return aRet.GetColor();
+ }
return fOldValue + (fValue - fOldValue) * mnPercent;
}
return fValue;
commit ede371bd3322633d1098c1f26ebc438ff567f57e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sat Jan 4 15:56:57 2014 +0100
initial work on supporting LineColor mapping in bubble charts
Change-Id: I9eab939ce8859ad30aeaa58b3b942004043fe295
diff --git a/chart2/source/view/charttypes/BubbleChart.cxx b/chart2/source/view/charttypes/BubbleChart.cxx
index a2e5dca..f25ddf3 100644
--- a/chart2/source/view/charttypes/BubbleChart.cxx
+++ b/chart2/source/view/charttypes/BubbleChart.cxx
@@ -249,6 +249,7 @@ void BubbleChart::createShapes()
continue;
bool bHasFillColorMapping = pSeries->hasPropertyMapping("FillColor");
+ bool bHasBorderColorMapping = pSeries->hasPropertyMapping("LineColor");
uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes = getSeriesGroupShape(*aSeriesIter, xSeriesTarget);
@@ -327,6 +328,12 @@ void BubbleChart::createShapes()
xProps->setPropertyValue("FillColor", uno::makeAny(static_cast<sal_Int32>(
pSeries->getValueByProperty(nIndex, "FillColor"))));
}
+ if(bHasBorderColorMapping)
+ {
+ uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY_THROW );
+ xProps->setPropertyValue("LineColor", uno::makeAny(static_cast<sal_Int32>(
+ pSeries->getValueByProperty(nIndex, "LineColor"))));
+ }
m_pShapeFactory->setShapeName( xShape, "MarkHandles" );
More information about the Libreoffice-commits
mailing list