discuss-gnustep
[Top][All Lists]
Advanced

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

Re: problems with gnustep-drawn window decorations and gui elements.


From: Eric Wasylishen
Subject: Re: problems with gnustep-drawn window decorations and gui elements.
Date: Tue, 31 May 2011 14:00:40 -0600

On 2011-05-31, at 8:59 AM, Riccardo Mottola wrote:

> Hi,
> 
> indeed, opening the image in gimp showed something corrupted... transparent. 
> I reverted that specific miniaturize image, corrected the DPI to 72 and now 
> it displays correct (ie. not reversed).

Hm, weird. I used imagemagick's mogrify command with the operation "-density 
72x72" which the docs say only changes the metadata - must be a bug that made 
it corrupt the image. Thanks for fixing it. I should probably check the other 
images I modified in that commit.

> 
> However the elements still have the offset problem.
> 

I looked in to this a bit. The basic problem is drawing a 9x9 image in a 
even-sized button (14x14 I think?). The commit that probably caused it was my 
r33002 where I added rounding to -[NSButtonCell.m drawImage:withFrame:inView:] 
Previous to that we were depending on the backend to pixel align the image 
location.

Unfortunately it's not as simple as just using floor() instead of round() in 
[NSButtonCell.m drawImage:withFrame:inView:]...

I attached a screenshot of a test I did with a pair of 16x16 buttons, the one 
on the left with a 9x9 image and the one on the right with a 8x8 image. To me 
both os the OS X buttons "look" like their image is centred, but the 9x9 image 
one on GS looks like the image is too far to the right (same problem as with 
the scroller arrows.) 

From the looks of it, cocoa is treating the button as having a 1pt border on 
the top and left sides, and a 2pt border on the bottom and right sides. This 
seems to make images 'feel' like they centre better. GS on the other hand 
treats the border as 2 pt all around. So, we could try copying cocoa's 
behaviour, which would involve modifying the api of the GSTheme method for 
getting button borders to return a separate left, top, right, and bottom 
dimension (which I think we should do anyway.) Thoughts?

--Eric

PNG image



reply via email to

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