Panther printing damages display graphics context
Panther printing damages display graphics context
- Subject: Panther printing damages display graphics context
- From: Seth Delackner <email@hidden>
- Date: Thu, 6 Nov 2003 00:47:25 +0000
- Mail-followup-to: email@hidden
We have your standard scrollview containing a textview with a
horizontal ruler. It supports zooming, via changing the document
bounds and frame. When we print, we temporarily disable window
flushing, set our bounds to 100% zoom, and then print. After
printing has finished, in Panther, the ruler is clearly the ruler
that was printed (since it shows 100% markers) and the content view
has had the 100% content drawn on it.
Again, none of this is a problem in Jaguar.
The only way we have found that fixes both of these is:
- (void)endDocument
{
// restore previous zoom setting
NSRect brect = [self bounds] ;
NSRect frect = _cachedFrame ;
NSScrollView* sv = [self enclosingScrollView];
BOOL rulersVisible = [sv rulersVisible];
[super endDocument] ;
//// Below the hack to make the ruler update
//// { begin hack
[sv setRulersVisible: NO];
[[sv horizontalRulerView] invalidateHashMarks];
[[sv verticalRulerView] invalidateHashMarks];
[sv display];
[sv setRulersVisible: YES];
[sv display];
if (! rulersVisible)
[sv setRulersVisible: NO];
[self setNeedsDisplay: YES] ;
//// } end hack
//// To make the content update, we had to re-enable window
//// flushing before we restore our correct frame and bounds.
//// Restoring the values before enabling flushing doesn't seem to work.
[[self window] enableFlushWindow] ;
[self setFrame: frect] ;
[self setBounds: brect] ;
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.