• 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
drawPageBorderWithSize: and NSPrintScalingFactor breakage in Tiger
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

drawPageBorderWithSize: and NSPrintScalingFactor breakage in Tiger


  • Subject: drawPageBorderWithSize: and NSPrintScalingFactor breakage in Tiger
  • From: Kelvin Delbarre <email@hidden>
  • Date: Sun, 8 May 2005 15:36:56 -0400

If you're using drawPageBorderWithSize: to print headers and footers you might want to test scaled printing in Tiger. My drawPageBorderWithSize: works fine in 10.1, 10.2 and 10.3, but breaks in Tiger when printing at a scaling factor other than 1. The release notes offer this:

NSView -drawPageBorderWithSize: fix (Section added since WWDC)

On previous versions of Mac OS X, locking focus to draw in an override of NSView's -drawPageBorderWithSize: method applies a transform and clip that are unsuitable for drawing in the page border area. A workaround for this issue is discussed in Cocoa : Printing : Providing a Custom Pagination Scheme. On Tiger, the workaround is no longer necessary, but will cause no harm in applications that employ it.

I assume that the workaround they're referring to is this:
In this method, first save the view’s existing body frame—it will need to be restored at the end of the method. Once the old frame is saved, resize the body frame to a rect with origin (0, 0) and a size equal to the incoming borderSize parameter. This new frame now encompasses the margins instead of hiding them.
However, at a scaling factor of 50% it seems that (0,0) is now half- way down the page. It makes no difference if I'm using the aforementioned workaround or not; my drawPageBorderWithSize: can't draw in the top margin. (I'm using a custom subclass of NSTextView and isFlipped == YES. You might not have a problem if your view isn't flipped.)

To see what I mean you can try OmniWeb (5.1.1 Beta 1), which appears to suffer similar problems. Set page scaling to 50% in Page Setup, and you'll find that the headers and footers are printed in the lower half of the page. _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Prev by Date: Re: Tiger documentation update
  • Next by Date: Re: NSOutlineView, NSTreeController and itemForPersistentObject...
  • Previous by thread: Re: [NSInternalInconsistencyException] Setting a drawer's new content view under Tiger (SOLVED)
  • Next by thread: Spotlight: Indexing WebKit archives
  • Index(es):
    • Date
    • Thread