Re: NSDraggingSession distorts the images I give it
Hi Jon,toggle quoted messageShow quoted text
The images are square - the rect returned by -imageRectForItemAtIndex is used to render them in the view as well as supplying the frame to the NSDraggingItem. That’s why it seems odd to me that the drag changes it.
The original image is actually a PDF Representation with a size of 93, 93. The image frame for drawing (and dragging) is 76, 76. This size depends on the ‘icon size’ the user chooses for that interface - small, medium or large. 76 is the medium size. While the images themselves may not always look square, whatever is rendered has a media box that is square, and the icon is rendered centred in that square, scaled to the longer side. What that means is that no matter what overall shape the image is, the icon that results is square - it just contains some extra transparent background if needed.
In any case, the same rect is always used for rendering the image in the view and for the dragging frame. So even if it wasn’t square, they should agree.
On 6 Nov 2019, at 4:13 pm, Jon Gotow <firstname.lastname@example.org> wrote: