diff options
Diffstat (limited to 'src/nsimage.m')
| -rw-r--r-- | src/nsimage.m | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/nsimage.m b/src/nsimage.m index 370cf832c7c..884c0763fd4 100644 --- a/src/nsimage.m +++ b/src/nsimage.m | |||
| @@ -403,7 +403,6 @@ static EmacsImage *ImageList = nil; | |||
| 403 | if ([rep respondsToSelector: @selector (getBitmapDataPlanes:)]) | 403 | if ([rep respondsToSelector: @selector (getBitmapDataPlanes:)]) |
| 404 | { | 404 | { |
| 405 | bmRep = (NSBitmapImageRep *) rep; | 405 | bmRep = (NSBitmapImageRep *) rep; |
| 406 | onTiger = [bmRep respondsToSelector: @selector (colorAtX:y:)]; | ||
| 407 | 406 | ||
| 408 | if ([bmRep numberOfPlanes] >= 3) | 407 | if ([bmRep numberOfPlanes] >= 3) |
| 409 | [bmRep getBitmapDataPlanes: pixmapData]; | 408 | [bmRep getBitmapDataPlanes: pixmapData]; |
| @@ -435,7 +434,7 @@ static EmacsImage *ImageList = nil; | |||
| 435 | | (pixmapData[0][loc] << 16) | (pixmapData[1][loc] << 8) | 434 | | (pixmapData[0][loc] << 16) | (pixmapData[1][loc] << 8) |
| 436 | | (pixmapData[2][loc]); | 435 | | (pixmapData[2][loc]); |
| 437 | } | 436 | } |
| 438 | else if (onTiger) | 437 | else |
| 439 | { | 438 | { |
| 440 | NSColor *color = [bmRep colorAtX: x y: y]; | 439 | NSColor *color = [bmRep colorAtX: x y: y]; |
| 441 | CGFloat r, g, b, a; | 440 | CGFloat r, g, b, a; |
| @@ -445,7 +444,6 @@ static EmacsImage *ImageList = nil; | |||
| 445 | | ((int)(b * 255.0)); | 444 | | ((int)(b * 255.0)); |
| 446 | 445 | ||
| 447 | } | 446 | } |
| 448 | return 0; | ||
| 449 | } | 447 | } |
| 450 | 448 | ||
| 451 | - (void) setPixelAtX: (int)x Y: (int)y toRed: (unsigned char)r | 449 | - (void) setPixelAtX: (int)x Y: (int)y toRed: (unsigned char)r |
| @@ -463,7 +461,7 @@ static EmacsImage *ImageList = nil; | |||
| 463 | pixmapData[2][loc] = b; | 461 | pixmapData[2][loc] = b; |
| 464 | pixmapData[3][loc] = a; | 462 | pixmapData[3][loc] = a; |
| 465 | } | 463 | } |
| 466 | else if (onTiger) | 464 | else |
| 467 | { | 465 | { |
| 468 | [bmRep setColor: | 466 | [bmRep setColor: |
| 469 | [NSColor colorWithCalibratedRed: (r/255.0) green: (g/255.0) | 467 | [NSColor colorWithCalibratedRed: (r/255.0) green: (g/255.0) |
| @@ -483,7 +481,7 @@ static EmacsImage *ImageList = nil; | |||
| 483 | 481 | ||
| 484 | pixmapData[3][loc] = a; | 482 | pixmapData[3][loc] = a; |
| 485 | } | 483 | } |
| 486 | else if (onTiger) | 484 | else |
| 487 | { | 485 | { |
| 488 | NSColor *color = [bmRep colorAtX: x y: y]; | 486 | NSColor *color = [bmRep colorAtX: x y: y]; |
| 489 | color = [color colorWithAlphaComponent: (a / 255.0)]; | 487 | color = [color colorWithAlphaComponent: (a / 255.0)]; |