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

 
 

You are not allowed to post comments on this tracker with your current authentication level.

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

Submitted by:  Quentin Mathé <qmathe>
Submitted on:  Tue 03 Nov 2009 05:23:40 PM UTC  
 
Category: Gui/AppKitSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: Fred Kiefer <FredKiefer>
Open/Closed: Closed

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>
Project Member
Wed 04 Nov 2009 10:32:47 PM UTC, comment #3:

OK, try once more with my recent changes.

Fred Kiefer <FredKiefer>
Project MemberIn charge of this item.
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>
Project Member
Tue 03 Nov 2009 11:08:45 PM UTC, comment #1:

Should be fixed in SVN now.

Fred Kiefer <FredKiefer>
Project MemberIn charge of this item.
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>
Project Member

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 05 Nov 2009 12:09:59 AM UTCqmatheStatusReady For Test=>Fixed
      Open/ClosedIn Test=>Closed
    Tue 03 Nov 2009 11:08:45 PM UTCFredKieferOpen/ClosedOpen=>In Test
      StatusNone=>Ready For Test
      Assigned toNone=>FredKiefer

    Back to the top


    Powered by Savane 3.1-cleanup1