gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: migration to CGFloat for NSColor?


From: Eric Wasylishen
Subject: Re: migration to CGFloat for NSColor?
Date: Tue, 25 Oct 2011 18:42:22 -0600

On 2011-10-25, at 2:43 PM, Fred Kiefer wrote:

> On 25.10.2011 21:00, Eric Wasylishen wrote:
>> Hi, I started writing a patch to migrate NSColor to use CGFloat (in
>> response to the bug report about -getComponents: taking a pointer to
>> floats julian reported.) Of course, doing this will break any
>> application code which uses that method. Do we want to do this? My
>> feeling is, it is better to do it now than to postpone the change. I
>> had to make updates in the color pickers, NSBitmapImageRep, and also
>> updated the private -[NSGraphicsContext GSSetStroke/FillColor:]
>> method to take CGFloat.
>> 
>> There are also a lot of DPS/PS functions that take pointers to floats
>> (for both setting colors, and font advances) - I guess those should
>> not be modified, since that would break older OpenStep applications.
>> 
>> Thoughts?
> 
> First off, it will only change things for 64bit systems, everything stays the 
> same for 32bit. And even on 64 bit systems the compiler will convert most 
> usages when recompiling existing applications. The problematic methods are 
> the ones where we pass a pointer to a CGFloat value. These are the getXXX 
> methods and
> colorWithColorSpace:components:count: and I would expect these get used less 
> often in normal applications.
> So from my side this is a go forward advice. We need to rewrite the rest of 
> gui to use CGFloat anyway, better we start off doing it now.
> 
> I wouldn't touch the PS/DPS functions for now, the float precision is good 
> enough anyway.
> 
Ok, I committed the patch. back needs to be recompiled because I changed the 
-GSSetStroke/FillColor: method on NSGraphicsContext.

Eric


reply via email to

[Prev in Thread] Current Thread [Next in Thread]