[Libreoffice-commits] core.git: drawinglayer/source
Noel Grandin
noel.grandin at collabora.co.uk
Mon Mar 5 10:09:07 UTC 2018
drawinglayer/source/primitive2d/sceneprimitive2d.cxx | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
New commits:
commit 1e89b32c654b471f5fdce65d63d49cfcc90826b1
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Mon Mar 5 11:16:12 2018 +0200
tdf#116001 Incorrect Colors in Chart Wall Area (2nd attempt)
regression from
commit b10c7022f1be6e4825269bd5872575b5b53744ef
"use RawBitmap in BPixelRasterToBitmapEx"
fix attempt at fixing it in
commit 3d400321910ff0fe89ab8c70c59432e676cb1340
"tdf#116001 Incorrect Colors in Chart Wall Area"
was incomplete. the drawinglayer code was (a) not initialising the
background transparency on all pixels and (b) not calling the Color
constructor correctly.
Change-Id: I1cf7d7d5eb67ba472e17790b18c33d8e4b97ae4c
Reviewed-on: https://gerrit.libreoffice.org/50764
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
index 98fb19bfe172..98aa9aba0b1c 100644
--- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
@@ -84,11 +84,13 @@ namespace
if(nOpacity)
{
aContent.SetPixel(y, x, Color(
+ 255 - static_cast<sal_uInt8>(nOpacity),
static_cast<sal_uInt8>(nRed / nDivisor),
static_cast<sal_uInt8>(nGreen / nDivisor),
- static_cast<sal_uInt8>(nBlue / nDivisor),
- 255 - static_cast<sal_uInt8>(nOpacity)));
+ static_cast<sal_uInt8>(nBlue / nDivisor) ));
}
+ else
+ aContent.SetPixel(y, x, Color(255, 0, 0, 0));
}
}
}
@@ -104,8 +106,10 @@ namespace
if(rPixel.getOpacity())
{
- aContent.SetPixel(y, x, Color(rPixel.getRed(), rPixel.getGreen(), rPixel.getBlue(), 255 - rPixel.getOpacity()));
+ aContent.SetPixel(y, x, Color(255 - rPixel.getOpacity(), rPixel.getRed(), rPixel.getGreen(), rPixel.getBlue()));
}
+ else
+ aContent.SetPixel(y, x, Color(255, 0, 0, 0));
}
}
}
More information about the Libreoffice-commits
mailing list