Commit 611c1595 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Scale cursors for Retina mode, now that user32 scales them with DPI.

When they were always 32x32, treating that size as though it were in Cocoa's virtual "points" rather than pixels produced good results even though it wasn't really correct. Signed-off-by: 's avatarKen Thomases <ken@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent cbfa90c3
......@@ -992,12 +992,14 @@ static NSString* WineLocalizedString(unsigned int stringID)
{
NSDictionary* frame = [cursorFrames objectAtIndex:cursorFrame];
CGImageRef cgimage = (CGImageRef)[frame objectForKey:@"image"];
NSImage* image = [[NSImage alloc] initWithCGImage:cgimage size:NSZeroSize];
CGSize size = CGSizeMake(CGImageGetWidth(cgimage), CGImageGetHeight(cgimage));
NSImage* image = [[NSImage alloc] initWithCGImage:cgimage size:NSSizeFromCGSize(cgsize_mac_from_win(size))];
CFDictionaryRef hotSpotDict = (CFDictionaryRef)[frame objectForKey:@"hotSpot"];
CGPoint hotSpot;
if (!CGPointMakeWithDictionaryRepresentation(hotSpotDict, &hotSpot))
hotSpot = CGPointZero;
hotSpot = cgpoint_mac_from_win(hotSpot);
self.cursor = [[[NSCursor alloc] initWithImage:image hotSpot:NSPointFromCGPoint(hotSpot)] autorelease];
[image release];
[self unhideCursor];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment