Yes, it is called outside my custom preview code. And values of maxScanArea, [self bounds] are correct. Also if I replace [image drawInRect:...] with solid color fill [NSBezierPath fillRect:maxScanArea], everything works as I expect.

On 12.11.2008, at 1:53, Andy Lee wrote:

On Nov 11, 2008, at 5:17 PM, Alexander Shmelev wrote:
- (void) drawRect:(NSRect)rect
{


        // Drawing image in preview
        if (image) {
                NSRect imageRect;
                imageRect.origin = NSZeroPoint;
                imageRect.size = [image size];
                
                [image drawInRect:maxScanArea
                                 fromRect:imageRect
                                operation:NSCompositeSourceOver
                                 fraction:1];
// I want image to be drawn in maxScanArea rect, but it is drawn in [self bounds] rect.

        }
}

I don't see a -setPreviewWidth:height: message anywhere. Have you confirmed that it is indeed called? I would put a breakpoint in both -setPreviewWidth:height: and -drawRect: and make sure the values of maxScanArea and bounds are what you expect.

--Andy


_______________________________________________

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