• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
PDFView caching issue?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: a bug in iphone SDK's creation of view based xib files.
  • Next by Date: How does launchAppWithBundleIdentifier work?
  • Previous by thread: Re: [iphone] ebook
  • Next by thread: How does launchAppWithBundleIdentifier work?
  • Index(es):
    • Date
    • Thread