* ColorPickers/GSWheelColorPicker.m: Choose the color wheel bitmap size

by converting the bounds rect to window base coordinates


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32899 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Eric Wasylishen 2011-04-19 08:59:03 +00:00
parent d92c92984d
commit dd335948b1
2 changed files with 15 additions and 10 deletions

View file

@ -1,3 +1,8 @@
2011-04-19 Eric Wasylishen <ewasylishen@gmail.com>
* ColorPickers/GSWheelColorPicker.m: Choose the color wheel bitmap size
by converting the bounds rect to window base coordinates
2011-04-19 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSScreen.m: Read -userSpaceScaleFactor from the GSScaleFactor

View file

@ -187,24 +187,24 @@
-(void) regenerateImage
{
NSRect frame = [self bounds];
NSSize size = [self convertSizeToBase: [self bounds].size];
CGFloat cx, cy, cr;
[image release];
image = nil;
cx = (frame.origin.x + frame.size.width) / 2;
cy = (frame.origin.y + frame.size.height) / 2;
cx = (size.width) / 2;
cy = (size.height) / 2;
cr = frame.size.width;
if (cr > frame.size.height)
cr = frame.size.height;
cr = size.width;
if (cr > size.height)
cr = size.height;
cr = cr / 2 - 2;
{
NSUInteger width = frame.size.width;
NSUInteger height = frame.size.height;
NSUInteger width = size.width;
NSUInteger height = size.height;
NSUInteger bytesPerRow;
NSBitmapImageRep *bmp;
unsigned char *data;
@ -303,7 +303,7 @@
}
}
image = [[NSImage alloc] initWithSize: frame.size];
image = [[NSImage alloc] initWithSize: [self bounds].size];
[image addRepresentation: bmp];
[bmp release];
}