From 6721baa40e242347f6875a234ebc5c913c0d22b6 Mon Sep 17 00:00:00 2001 From: David Capello Date: Fri, 25 Aug 2017 14:27:44 -0300 Subject: [PATCH] Fix bug creating buggy macOS cursors with initWithCGImage I'm not sure why the bug was caused (press mouse button, drag to the edge, drag cursor back to the window, release button), but it looks like using a NSBitmapImageRep and creating the NSImage with that bitmap works properly. --- src/she/osx/window.mm | 85 ++++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 42 deletions(-) diff --git a/src/she/osx/window.mm b/src/she/osx/window.mm index aa2a11205..deed7c90a 100644 --- a/src/she/osx/window.mm +++ b/src/she/osx/window.mm @@ -1,5 +1,5 @@ // SHE library -// Copyright (C) 2012-2016 David Capello +// Copyright (C) 2012-2017 David Capello // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. @@ -173,52 +173,53 @@ using namespace she; const int w = scale*surface->width(); const int h = scale*surface->height(); - std::vector buf(4*w*h); - uint32_t* bits = &buf[0]; - - for (int y=0; ygetData(0, y/scale); - for (int x=0, u=0; xgetData(0, y/scale); + for (int x=0, u=0; x