View Issue Details

IDProjectCategoryView StatusLast Update
0018330LazarusWidgetsetpublic2011-12-01 11:26
ReporterPhilAssigned ToZeljan Rikalo 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
PlatformMacOSOS XOS Version10.6
Product Version0.9.29 (SVN)Product Build28827 
Target VersionFixed in Version0.9.29 (SVN) 
Summary0018330: SetGCRasterOperation setting wrong GDK raster op values
DescriptionSetGCRasterOperation 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;



TagsNo tags attached.
Fixed in Revision28844
LazTarget0.99.0
WidgetsetGTK 2
Attached Files

Activities

Vincent Snijders

2010-12-29 10:37

manager   ~0044676

After testing it may be merged to the fixes branch, time permitting.

Zeljan Rikalo

2010-12-31 09:13

developer   ~0044746

Please test and close if ok.

Issue History

Date Modified Username Field Change
2010-12-28 04:31 Phil New Issue
2010-12-28 04:31 Phil Widgetset => GTK 2
2010-12-29 10:37 Vincent Snijders LazTarget => 0.99.0
2010-12-29 10:37 Vincent Snijders Note Added: 0044676
2010-12-29 10:37 Vincent Snijders Status new => acknowledged
2010-12-29 10:37 Vincent Snijders Target Version => 0.99.0
2010-12-31 09:13 Zeljan Rikalo Fixed in Revision => 28844
2010-12-31 09:13 Zeljan Rikalo Status acknowledged => resolved
2010-12-31 09:13 Zeljan Rikalo Resolution open => fixed
2010-12-31 09:13 Zeljan Rikalo Assigned To => Zeljan Rikalo
2010-12-31 09:13 Zeljan Rikalo Note Added: 0044746
2011-01-23 22:09 Vincent Snijders Fixed in Version => 0.9.29 (SVN)
2011-12-01 11:26 Marc Weustink Status resolved => closed