summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-01-13 20:25:11 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-01-14 07:46:51 +0100
commit0918eade90e19dd8e9a246446dcb9463c6c7f7cc (patch)
treeecc68e62607661885607a066efec8f8919e3c191 /vcl
parent8b4f13e152acac20930db13fd4ec4f3d31627c09 (diff)
remove unnecessary macos cursor code
certainly on my Catalina macOS install it makes no difference with or without this code. I could have sworn it was necessary back when I added it, but since I'm going on snippets of hacking scattered around the net (because Apple 's documentation is rather lacking), who knows. Change-Id: I8a66a5179ab7ca8138e54a57564b8d453848c0e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109241 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/osx/saldata.cxx25
1 files changed, 3 insertions, 22 deletions
diff --git a/vcl/osx/saldata.cxx b/vcl/osx/saldata.cxx
index 7a9f7b42dcfe..9c3f04dbbc7b 100644
--- a/vcl/osx/saldata.cxx
+++ b/vcl/osx/saldata.cxx
@@ -135,9 +135,9 @@ NSImage* load_icon_by_name(const OUString& rIconName)
auto length = xMemStm->TellEnd();
NSData * byteData = [NSData dataWithBytes:data length:length];
NSBitmapImageRep * imageRep = [NSBitmapImageRep imageRepWithData:byteData];
- NSSize imageSize = NSMakeSize(CGImageGetWidth([imageRep CGImage]), CGImageGetHeight([imageRep CGImage]));
+// NSSize imageSize = NSMakeSize(imageRep.size;
- NSImage * image = [[NSImage alloc] initWithSize:imageSize];
+ NSImage * image = [[NSImage alloc] initWithSize:imageRep.size];
[image addRepresentation:imageRep];
return image;
}
@@ -248,26 +248,7 @@ NSCursor* SalData::getCursor( PointerStyle i_eStyle )
}
NSImage* theImage = load_icon_by_name(aIconName);
- assert ([theImage size].width == 256 || [theImage size].width == 128 || [theImage size].width == 32);
- if ([theImage size].width == 256 || [theImage size].width == 128)
- {
- // If we have a 256x256 or 128x128 image, generate scaled versions of it.
- // This will result in macOS picking a reasonably sized image for different screen dpi.
- NSSize cursorSize = NSMakeSize(32,32);
- NSImage *multiResImage = [[NSImage alloc] initWithSize:cursorSize];
- for (int scale = 1; scale <= 4; scale++) {
- NSAffineTransform *xform = [[NSAffineTransform alloc] init];
- [xform scaleBy:scale];
- id hints = @{ NSImageHintCTM: xform };
- CGImageRef rasterCGImage = [theImage CGImageForProposedRect:nullptr context:nil hints:hints];
- NSBitmapImageRep *rep = [[NSBitmapImageRep alloc] initWithCGImage:rasterCGImage];
- [rep setSize:cursorSize];
- [multiResImage addRepresentation:rep];
- }
- pCurs = [[NSCursor alloc] initWithImage: multiResImage hotSpot: aHotSpot];
- }
- else
- pCurs = [[NSCursor alloc] initWithImage: theImage hotSpot: aHotSpot];
+ pCurs = [[NSCursor alloc] initWithImage: theImage hotSpot: aHotSpot];
maCursors[ i_eStyle ] = pCurs;
return pCurs;