* 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:
ericwa 2011-04-19 08:59:03 +00:00
parent 5d40709f7d
commit 8a5712d421
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> 2011-04-19 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSScreen.m: Read -userSpaceScaleFactor from the GSScaleFactor * Source/NSScreen.m: Read -userSpaceScaleFactor from the GSScaleFactor

View file

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