Re: NSDraggingSession distorts the images I give it

Jon Gotow

On Nov 6, 2019, at 2:42 AM, Graham Cox <graham@...> wrote:

Turns out you’re right - the images were NOT square - they vary. It just so happened that the first image in my selection was square, and that’s what I observed in the debugger. Since it was in line with my expectations, it seemed to make sense. But actually later the images are rendered INTO a square, with the rectangle scaled to fit.

Anyway, NOT forcing them to be square, but instead doing the same “fit” calculation to arrive at a dragging frame solves the problem.

So thanks for getting me to examine my assumptions here - it was on the right track.
I'm glad I could help. It's just one of those things I've run into myself a million times - I _think_ I've checked all my assumptions when I'm debugging something, and end up off in the weeds (for hours or more, sometimes) because one of my basic assumptions was wrong. Fortunately, you posted that screen recording showing the behavior so I could pause it and see what the exact scaling was. Nothing like having plenty of data to look at - that makes it easy to help solve the problem.

Good luck with your app!

- Jon

Join { to automatically receive all group messages.