bugGNUstep - Bugs: bug #27927, NSColor setFill not well supported...

Group
 
 

bug #27927: NSColor setFill not well supported and setStroke broken

Submitter:  Quentin Mathé <qmathe>
Submitted:  Tue 03 Nov 2009 05:23:40 PM UTC
   
 
Category:  Gui/AppKit Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  FredKiefer
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 05 Nov 2009 12:09:59 AM UTC, comment #4: 

I justed tested my code with both art and cairo backends, and everything is ok now.
Thanks a lot.

Quentin Mathé <qmathe>
Group Member
Wed 04 Nov 2009 10:32:47 PM UTC, comment #3: 

OK, try once more with my recent changes.

Fred Kiefer <FredKiefer>
Group Member
Wed 04 Nov 2009 02:42:03 PM UTC, comment #2: 

Hi Fred,

-setStroke: works now and I don't get any error logged as previously with -setStroke: and -setFill:. This is great.
However there is still a problem with both methods (I tested both art and cairo backends). They ignore the color alpha component unlike -set.

The code below works as expected:
[[[NSColor redColor] colorWithAlphaComponent: 0.5] set];
[NSBezierPath fillRect: aRect];

But with -setFill: (or -setStroke) as below, the alpha component is ignored, and the filled rect is just opaque red:
[[[NSColor redColor] colorWithAlphaComponent: 0.5] setFill];
[NSBezierPath fillRect: aRect];

Quentin Mathé <qmathe>
Group Member
Tue 03 Nov 2009 11:08:45 PM UTC, comment #1: 

Should be fixed in SVN now.

Fred Kiefer <FredKiefer>
Group Member
Tue 03 Nov 2009 05:23:40 PM UTC, original submission:  

Ubuntu 9.04 and Gui + Cairo backend (svn trunk r28906). iirc the same problems also hold for the art backend.

Here are some -setFill and -setStroke use cases that works well on Cocoa but not on GNUstep.

The code below works but logs the following error:
DPSundefined: No fill colorspace defined, assume DeviceRGB

[[NSColor redColor] setFill];
[NSBezierPath fillRect: aRect];

And the following code logs the same error but doesn't work, the alpha component is just ignored:

[[[NSColor redColor] colorWithAlphaComponent: 0.5] setFill];
[NSBezierPath fillRect: aRect];

-setStroke doesn't work at all and logs a similar error than -setFill (DPSundefined: No stroke colorspace defined, assume DeviceRGB). For example the code below just draws a red border and not a green one:

[NSBezierPath setDefaultLineWidth: 5.0];
[[NSColor redColor] setFill]; // You can replace -setFill by -set here, the result is the same
[[NSColor greenColor] setStroke];
[NSBezierPath strokeRect: aRect];

Quentin.

Quentin Mathé <qmathe>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by FredKiefer (Posted a comment)
  • -email is unavailable- added by qmathe (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-11-05 qmathe StatusReady For Test Fixed
        Open/ClosedIn Test Closed
    2009-11-03 FredKiefer Open/ClosedOpen In Test
        StatusNone Ready For Test
        Assigned toNone FredKiefer

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code