PDFView caching issue?
PDFView caching issue?
- Subject: PDFView caching issue?
- From: DairyKnight <email@hidden>
- Date: Thu, 3 Sep 2009 21:16:30 +0800
Hi,
I'm trying to do some customized drawing in a PDFView, so I overrided
'drawPage' as follows:
- (void)drawPage:(PDFPage *)page
{
int width = [page boundsForBox:kPDFDisplayBoxMediaBox].size.width;
int height = [page boundsForBox:kPDFDisplayBoxMediaBox].size.height;
int x = [page boundsForBox:kPDFDisplayBoxMediaBox].origin.x;
int y = [page boundsForBox:kPDFDisplayBoxMediaBox].origin.y;
NSRect bounds;
NSBezierPath *path;
[super drawPage:page];
bounds = NSMakeRect(x, y + height, x + 100, y + height - 100);
path = [NSBezierPath bezierPathWithRect: bounds];
[[NSColor colorWithDeviceRed: 1.0 green: 0.0 blue: 0.0 alpha: 0.1] set];
[path fill];
[[NSColor redColor] set];
[path stroke];
}
The problem here is that if the filled path is very big, say covers most of
the page, and the user scrolls the PDFView very fast,
the path is sometimes only partially drawn. My guess is due to the NSView
caching facility. Anyone sees a solution to this?
Thanks.
DairyKnight
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden