summaryrefslogtreecommitdiff
path: root/drawinglayer/source
diff options
context:
space:
mode:
authorofftkp <parisoplop@gmail.com>2023-12-13 03:39:14 +0200
committerTomaž Vajngerl <quikee@gmail.com>2024-01-16 14:19:56 +0100
commit925c05ee1a1259641a28fe43588f425aff06b95e (patch)
treeaa9bcaf5f818efbd0e17242eefb62adb40b0cc72 /drawinglayer/source
parentbd570609281d92a48e7b3c0fe2d0c90457e7e3d5 (diff)
chart2: Make automatic area coloring for charts work for tiled rendering
Charts now get a temporary colored applied to the area property set if their color was set to automatic, which is done by default in tiled rendering mode. Change-Id: Ic6bd19b97d2a0ffa2a1ad516cfa202e2f4921db7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160659 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'drawinglayer/source')
-rw-r--r--drawinglayer/source/geometry/viewinformation2d.cxx13
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx6
2 files changed, 17 insertions, 2 deletions
diff --git a/drawinglayer/source/geometry/viewinformation2d.cxx b/drawinglayer/source/geometry/viewinformation2d.cxx
index 67993d95544b..d238c9b893e0 100644
--- a/drawinglayer/source/geometry/viewinformation2d.cxx
+++ b/drawinglayer/source/geometry/viewinformation2d.cxx
@@ -87,6 +87,9 @@ protected:
// the point in time
double mfViewTime;
+ // color to use for automatic color
+ Color maAutoColor;
+
// allow to reduce DisplayQuality (e.g. sw 3d fallback renderer for interactions)
bool mbReducedDisplayQuality : 1;
@@ -106,6 +109,7 @@ public:
, maDiscreteViewport()
, mxVisualizedPage()
, mfViewTime(0.0)
+ , maAutoColor(COL_AUTO)
, mbReducedDisplayQuality(false)
, mbUseAntiAliasing(ViewInformation2D::getGlobalAntiAliasing())
, mbPixelSnapHairline(mbUseAntiAliasing && bForwardPixelSnapHairline)
@@ -190,6 +194,9 @@ public:
mxVisualizedPage = rNew;
}
+ Color getAutoColor() const { return maAutoColor; }
+ void setAutoColor(Color aNew) { maAutoColor = aNew; }
+
bool getReducedDisplayQuality() const { return mbReducedDisplayQuality; }
void setReducedDisplayQuality(bool bNew) { mbReducedDisplayQuality = bNew; }
@@ -205,7 +212,7 @@ public:
&& maViewTransformation == rCandidate.maViewTransformation
&& maViewport == rCandidate.maViewport
&& mxVisualizedPage == rCandidate.mxVisualizedPage
- && mfViewTime == rCandidate.mfViewTime
+ && mfViewTime == rCandidate.mfViewTime && maAutoColor == rCandidate.maAutoColor
&& mbReducedDisplayQuality == rCandidate.mbReducedDisplayQuality
&& mbUseAntiAliasing == rCandidate.mbUseAntiAliasing
&& mbPixelSnapHairline == rCandidate.mbPixelSnapHairline);
@@ -342,6 +349,10 @@ void ViewInformation2D::setUseAntiAliasing(bool bNew)
mpViewInformation2D->setUseAntiAliasing(bNew);
}
+Color ViewInformation2D::getAutoColor() const { return mpViewInformation2D->getAutoColor(); }
+
+void ViewInformation2D::setAutoColor(Color aNew) { mpViewInformation2D->setAutoColor(aNew); }
+
bool ViewInformation2D::getPixelSnapHairline() const
{
return mpViewInformation2D->getPixelSnapHairline();
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index bdea1cfa3198..f9b0e0df6159 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -115,7 +115,11 @@ void VclPixelProcessor2D::tryDrawPolyPolygonColorPrimitive2DDirect(
const basegfx::BColor aPolygonColor(
maBColorModifierStack.getModifiedColor(rSource.getBColor()));
- mpOutputDevice->SetFillColor(Color(aPolygonColor));
+ if (comphelper::LibreOfficeKit::isActive() && aPolygonColor.isAutomatic())
+ mpOutputDevice->SetFillColor(getViewInformation2D().getAutoColor());
+ else
+ mpOutputDevice->SetFillColor(Color(aPolygonColor));
+
mpOutputDevice->SetLineColor();
mpOutputDevice->DrawTransparent(maCurrentTransformation, rSource.getB2DPolyPolygon(),
fTransparency);