Fixed custom cursors on mac

This commit is contained in:
NeeEoo
2024-04-22 16:14:52 +02:00
parent a95988dbeb
commit 21a9cc7b8f
+4 -6
View File
@@ -106,16 +106,14 @@ namespace ExternalMac
cursor = [NSCursor openHandCursor];
break;
case CUSTOM:
NSString *cursorImageName = [NSString stringWithUTF8String:customCursor];
if (customCursorCache.find(cursorImageName.UTF8String) != customCursorCache.end())
cursor = customCursorCache[cursorImageName.UTF8String];
if (customCursorCache.find(customCursor) != customCursorCache.end())
cursor = customCursorCache[customCursor];
else
{
NSString *cursorImageName = [NSString stringWithUTF8String:customCursor];
NSImage *tmpImage = [NSImage imageNamed:cursorImageName];
NSImage *tmpImage = [[NSImage alloc] initWithContentsOfFile:cursorImageName];
if (tmpImage != nullptr)
if (tmpImage != nil)
{
cursor = [[NSCursor alloc] initWithImage:tmpImage hotSpot:NSMakePoint(customX, customY)];
customCursorCache[customCursor] = cursor;