Page MenuHome
Paste P1119

(An Untitled Masterwork)
ActivePublic

Authored by Brecht Van Lommel (brecht) on Sep 26 2019, 5:46 PM.
From 6f60b2be69a738fac6f370515cf6076f417d823e Mon Sep 17 00:00:00 2001
From: Brecht Van Lommel <brechtvanlommel@gmail.com>
Date: Thu, 26 Sep 2019 17:44:50 +0200
Subject: [PATCH] macOS custom cursor test
---
intern/ghost/intern/GHOST_WindowCocoa.mm | 4 +++-
.../Contents/Resources/cursor_crosshair.png | Bin 0 -> 199 bytes
2 files changed, 3 insertions(+), 1 deletion(-)
create mode 100644 release/darwin/Blender.app/Contents/Resources/cursor_crosshair.png
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm
index dff45ba85fb..69c48cf77d0 100644
--- a/intern/ghost/intern/GHOST_WindowCocoa.mm
+++ b/intern/ghost/intern/GHOST_WindowCocoa.mm
@@ -940,7 +940,9 @@ NSCursor *GHOST_WindowCocoa::getStandardCursor(GHOST_TStandardCursor shape) cons
case GHOST_kStandardCursorText:
return [NSCursor IBeamCursor];
case GHOST_kStandardCursorCrosshair:
- return [NSCursor crosshairCursor];
+ // TODO: this needs caching, and error and memory handling, but works for testing
+ return [[NSCursor alloc] initWithImage:[NSImage imageNamed:@"cursor_crosshair.png"]
+ hotSpot:NSMakePoint(0, 0)];
case GHOST_kStandardCursorUpDown:
case GHOST_kStandardCursorHorizontalSplit:
return [NSCursor resizeUpDownCursor];
diff --git a/release/darwin/Blender.app/Contents/Resources/cursor_crosshair.png b/release/darwin/Blender.app/Contents/Resources/cursor_crosshair.png
new file mode 100644
index 0000000000000000000000000000000000000000..f39fd2387021c08623d23265d11b520c6120dd3d
GIT binary patch
literal 199
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`eV#6kAr*{sCpEIV81l4ruc~Iq
zo3ZYatCgd<M#=PdVtd&hJyAOOR9UM3|Kt<iQqN^J`}8$MH}J3D&%z)ew&&YD6IadF
zxZn>l*P=Fx-kWZz&K>L_{$x(@`&gcS!$}pa|6DngZ#<b_&me6!tv+1uLF<*Mjg>kF
xzjtcfi8`FU<N^zW!{+wz58NVqm^RwfFsPraJ|g_U<`>Xq44$rjF6*2UngC<FODq5Y
literal 0
HcmV?d00001
--
2.21.0

Event Timeline