Kaydet (Commit) 1b3a39bf authored tarafından David Tardon's avatar David Tardon

fdo#65844 use right colors from palette

It is not correct to expect that the palette will always be the same as
default-constructed from VCL. For example, 1bit PICT images use reversed
white and black.

Change-Id: I6b5e7cd19af98202e80f4cff17fddaa3a3f0e3af
üst 33231f41
...@@ -471,8 +471,10 @@ void X11SalGraphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSa ...@@ -471,8 +471,10 @@ void X11SalGraphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSa
const BitmapPalette& rPalette = pBitmapBuffer->maPalette; const BitmapPalette& rPalette = pBitmapBuffer->maPalette;
if (rPalette.GetEntryCount() == 2) if (rPalette.GetEntryCount() == 2)
{ {
aNewVal.foreground = rColMap.GetPixel(ImplColorToSal(rPalette[0])); const BitmapColor aBlack( rPalette[rPalette.GetBestIndex( Color( COL_BLACK ) )] );
aNewVal.background = rColMap.GetPixel(ImplColorToSal(rPalette[1])); const BitmapColor aWhite( rPalette[rPalette.GetBestIndex( Color( COL_WHITE ) )] );
aNewVal.foreground = rColMap.GetPixel(ImplColorToSal(aWhite));
aNewVal.background = rColMap.GetPixel(ImplColorToSal(aBlack));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment