Explorar o código

* Fix to correctly write gray values from Johann (Bug ID 27924)

git-svn-id: trunk@30696 -
michael %!s(int64=10) %!d(string=hai) anos
pai
achega
e86aa04433
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      packages/fcl-image/src/fpwritepng.pp

+ 2 - 2
packages/fcl-image/src/fpwritepng.pp

@@ -475,13 +475,13 @@ end;
 function TFPWriterPNG.ColorDataGrayAB(color:TFPColor) : TColorData;
 begin
   result := ColorDataGrayB (color);
-  result := (result shl 8) and hi(color.Alpha);
+  result := (color.Alpha and $ff00) or result;
 end;
 
 function TFPWriterPNG.ColorDataGrayAW(color:TFPColor) : TColorData;
 begin
   result := ColorDataGrayW (color);
-  result := (result shl 16) and color.Alpha;
+  result := (color.Alpha shl 16) or result;
 end;
 
 function TFPWriterPNG.ColorDataColorB(color:TFPColor) : TColorData;