I'd like to get the "LightTable" sample code from Apple's website going (https://developer.apple.com/library/mac/#samplecode/LightTable/Introduction/Intro.html). It all compiles fine but dragging an image onto the running program window results in this error message being logged in the console:
** Canceling drag because exception 'CALayerInvalidGeometry' (reason 'CALayer position contains NaN: [nan nan]') was raised during a dragging session
and nothing happens.
I'm using Xcode 4.6.1 and OSX 10.8.3 The problem seems to be in the "LTMaskLayer" class. Specifically the setFrame function but after some tinkering I still can't get the app to work properly.
Seems like a good app, with lots of things to learn from, not just touch gestures and I'd really like to get it working. Many thanks to anyone who can help.
You're correct, the bug seems to be in -[LTMaskLayer setFrame:]
.
This experiment worked for me. Change:
if (!CGSizeEqualToSize(oldFrame.size, frame.size)) {
to
if (!CGSizeEqualToSize(oldFrame.size, frame.size) && !CGSizeEqualToSize(oldFrame.size, CGSizeZero)) {
It's entirely possible there's a better fix, but this should get you a little farther.