On 12 Nov 2008, at 9:56 am, Alexander Shmelev wrote:

Actually, I have one idea why this happens.
Maybe because usually width=8, height = 14 so [self bounds] returns NSRect(0,0,8.64,14.64). And maxScanArea = NSRect(0.32, 0.32, 8, 14). So there can be some approximation to integer value, not float.

But it it is true, how to deal with this?


I have noticed some inaccuracy with NSImage when drawing into very small non-integer rectangles. I didn't investigate too deeply but it seemed to be related to caching the image into a bitmap which of course has to have a whole number of pixels. I found a workaround in my case which was to suppress caching and draw the image at a larger size, changing the CTM on the fly to place it into my destination area. I'm afraid this was about 18 months ago so I forget the details and I can't put my finger on the precise code in question - but that was the gist of it.

--Graham
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to