summaryrefslogtreecommitdiff
path: root/include
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 /include
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 'include')
-rw-r--r--include/basegfx/color/bcolor.hxx4
-rw-r--r--include/drawinglayer/geometry/viewinformation2d.hxx4
-rw-r--r--include/tools/color.hxx5
3 files changed, 12 insertions, 1 deletions
diff --git a/include/basegfx/color/bcolor.hxx b/include/basegfx/color/bcolor.hxx
index a88488117ce2..584f9572e585 100644
--- a/include/basegfx/color/bcolor.hxx
+++ b/include/basegfx/color/bcolor.hxx
@@ -39,6 +39,8 @@ namespace basegfx
*/
class SAL_WARN_UNUSED BASEGFX_DLLPUBLIC BColor : public B3DTuple
{
+ bool bAutomatic = false;
+
public:
/** Create a Color with red, green and blue components from [0.0 to 1.0]
@@ -78,11 +80,13 @@ namespace basegfx
double getRed() const { return mnX; }
double getGreen() const { return mnY; }
double getBlue() const { return mnZ; }
+ bool isAutomatic() const { return bAutomatic; }
// data access write
void setRed(double fNew) { mnX = fNew; }
void setGreen(double fNew) { mnY = fNew; }
void setBlue(double fNew) { mnZ = fNew; }
+ void setAutomatic(bool bNew) { bAutomatic = bNew; }
/** *=operator to allow usage from BColor, too
*/
diff --git a/include/drawinglayer/geometry/viewinformation2d.hxx b/include/drawinglayer/geometry/viewinformation2d.hxx
index 8f1bd634fd58..79b07018c384 100644
--- a/include/drawinglayer/geometry/viewinformation2d.hxx
+++ b/include/drawinglayer/geometry/viewinformation2d.hxx
@@ -23,6 +23,7 @@
#include <sal/config.h>
#include <o3tl/cow_wrapper.hxx>
+#include <tools/color.hxx>
// predefines
@@ -159,6 +160,9 @@ public:
bool getPixelSnapHairline() const;
void setPixelSnapHairline(bool bNew);
+ Color getAutoColor() const;
+ void setAutoColor(Color aNew);
+
static void setGlobalAntiAliasing(bool bAntiAliasing, bool bTemporary);
static bool getGlobalAntiAliasing();
static void forwardPixelSnapHairline(bool bPixelSnapHairline);
diff --git a/include/tools/color.hxx b/include/tools/color.hxx
index 8ab35445893f..898524ac14a4 100644
--- a/include/tools/color.hxx
+++ b/include/tools/color.hxx
@@ -420,7 +420,10 @@ public:
*/
basegfx::BColor getBColor() const
{
- return basegfx::BColor(R / 255.0, G / 255.0, B / 255.0);
+ basegfx::BColor aColor(R / 255.0, G / 255.0, B / 255.0);
+ if (mValue == Color(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF).mValue)
+ aColor.setAutomatic(true);
+ return aColor;
}
};