SetGCRasterOperation setting wrong GDK raster op values
Original Reporter info from Mantis: Phil
-
Reporter name:
Original Reporter info from Mantis: Phil
- Reporter name:
Description:
SetGCRasterOperation was apparently written when the FPC GDK raster op values were misnumbered and the author adjusted accordingly for values above GDK_XOR.
See this posting for when the values were renumbered. See gdkgc.inc for GTK2, where they're now an enumerated type.
http://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg07673.html
Here is my fixed version. Although this is not a regression, it's a serious flaw in the GTK2 widgetset and should probably be merged into the 0.9.30 patches branch.
procedure SetGCRasterOperation(TheGC: PGDKGC; Rop: Cardinal);
begin
case Rop of
SRCCOPY : gdk_gc_set_function(TheGC, GDK_COPY);
SRCPAINT : gdk_gc_set_function(TheGC, GDK_OR);
SRCAND : gdk_gc_set_function(TheGC, GDK_AND);
SRCINVERT : gdk_gc_set_function(TheGC, GDK_XOR);
SRCERASE : gdk_gc_set_function(TheGC, GDK_AND_REVERSE);
NOTSRCCOPY : gdk_gc_set_function(TheGC, GDK_COPY_INVERT);
NOTSRCERASE : gdk_gc_set_function(TheGC, GDK_NOR);
MERGEPAINT : gdk_gc_set_function(TheGC, GDK_OR_INVERT);
DSTINVERT : gdk_gc_set_function(TheGC, GDK_INVERT);
BLACKNESS : gdk_gc_set_function(TheGC, GDK_CLEAR);
WHITENESS : gdk_gc_set_function(TheGC, GDK_SET);
else begin
gdk_gc_set_function(TheGC, GDK_COPY);
DebugLn('WARNING: [SetRasterOperation] Got unknown/unsupported CopyMode!!');
end;
end;
end;
Mantis conversion info:
- Mantis ID: 18330
- OS: OS X
- OS Build: 10.6
- Build: 28827
- Platform: Mac
- Version: 0.9.29 (SVN)
- Fixed in version: 0.9.29 (SVN)
- Fixed in revision: 28844 (#0f23c541)
- Target version: 0.99.0