summaryrefslogtreecommitdiff
path: root/src/Fl_cocoa.mm
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-09-12 11:07:03 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-09-12 11:07:03 +0200
commit87ee126e1fabd5ae5b1bc6738ff46e0c2b149804 (patch)
treec84e98d46eef4bb14624bac7a59e639878bbcff3 /src/Fl_cocoa.mm
parentd028f0b37d12636f1956ad59843d2dec96b12a91 (diff)
Allow use of Fl_Window::default_icon() with a scaled image.
Diffstat (limited to 'src/Fl_cocoa.mm')
-rw-r--r--src/Fl_cocoa.mm6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index f021cb750..ddcb6d4c1 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -4627,15 +4627,15 @@ Fl_Cocoa_Window_Driver::~Fl_Cocoa_Window_Driver()
static NSImage* rgb_to_nsimage(const Fl_RGB_Image *rgb) {
if (!rgb) return nil;
int ld = rgb->ld();
- if (!ld) ld = rgb->w() * rgb->d();
+ if (!ld) ld = rgb->data_w() * rgb->d();
NSImage *win_icon = nil;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
if (fl_mac_os_version >= 101000) {
- NSBitmapImageRep *bitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:rgb->w() pixelsHigh:rgb->h()
+ NSBitmapImageRep *bitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:rgb->data_w() pixelsHigh:rgb->data_h()
bitsPerSample:8 samplesPerPixel:rgb->d() hasAlpha:!(rgb->d() & 1) isPlanar:NO
colorSpaceName:(rgb->d()<=2) ? NSDeviceWhiteColorSpace : NSDeviceRGBColorSpace
bitmapFormat:NSAlphaNonpremultipliedBitmapFormat bytesPerRow:ld bitsPerPixel:rgb->d()*8]; // 10.4
- memcpy([bitmap bitmapData], rgb->array, rgb->h() * ld);
+ memcpy([bitmap bitmapData], rgb->array, rgb->data_h() * ld);
win_icon = [[NSImage alloc] initWithSize:NSMakeSize(0, 0)];
[win_icon addRepresentation:bitmap];
[bitmap release];