From b573cc35870b6a0e082c7d69cbb17e997e9192d9 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 22 Jan 2020 09:43:21 +0100 Subject: [PATCH] cocoa: fix compilation issues with new NSCursor hotspot code See #849 --- panda/src/cocoadisplay/cocoaGraphicsWindow.mm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/panda/src/cocoadisplay/cocoaGraphicsWindow.mm b/panda/src/cocoadisplay/cocoaGraphicsWindow.mm index e7d25c29d7..84a722e5c6 100644 --- a/panda/src/cocoadisplay/cocoaGraphicsWindow.mm +++ b/panda/src/cocoadisplay/cocoaGraphicsWindow.mm @@ -1421,17 +1421,17 @@ load_cursor(const Filename &filename) { CGFloat hotspot_x = 0.0f; CGFloat hotspot_y = 0.0f; - if (image_props[@"hotspotX"] != nil) { - hotspot_x = [(NSNumber *)image_props[@"hotspotX"] floatValue]; + if (NSNumber *number = [image_props objectForKey:@"hotspotX"]) { + hotspot_x = [number floatValue]; } - if (image_props[@"hotspotY"] != nil) { - hotspot_y = [(NSNumber *)image_props[@"hotspotY"] floatValue]; + if (NSNumber *number = [image_props objectForKey:@"hotspotY"]) { + hotspot_y = [number floatValue]; } [image_props release]; NSImage *image = [[NSImage alloc] initWithData:image_data]; - NSCursor *cursor; + NSCursor *cursor = nil; if (image != nil) { // Apple recognizes that hotspots are usually specified from a .cur // file, whose origin is in the top-left, so there's no need to flip