diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-05 11:16:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-05 11:08:45 +0100 |
commit | 1e89b32c654b471f5fdce65d63d49cfcc90826b1 (patch) | |
tree | 014ed5017fe40c085a00b7fd74db3f31c8bacf5f /drawinglayer/source | |
parent | 5d577e6cfab6c602a76029764c9467d15bdf8ba2 (diff) |
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@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer/source')
-rw-r--r-- | drawinglayer/source/primitive2d/sceneprimitive2d.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
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)); } } } |