mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 17:01:16 +00:00
Applied patch given by Mark Tracy for printing improvements.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23877 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
57435da7d5
commit
3c63c09716
4 changed files with 33 additions and 5 deletions
18
ChangeLog
18
ChangeLog
|
@ -1,3 +1,21 @@
|
||||||
|
2006-10-15 11:23-EDT Mark Tracy <tracy454 at concentric dot net>
|
||||||
|
|
||||||
|
* Source/NSPageLayout.m: NSPageLayout was setting a default page
|
||||||
|
scale of 100 cause: pageScale factor is displayed as percentage fix:
|
||||||
|
pageScale*100 sent to textfield and textfield/100 stored in pageScale.
|
||||||
|
NSPageLayout had different limits on scaling than NSPrintPanel fix:
|
||||||
|
adjust formatter max.
|
||||||
|
* Source/NSPrintOperation.m: NSPrintOperation would loop randomly
|
||||||
|
if a custom view replies YES to -knowsPageRange cause:
|
||||||
|
-_printPaginateWithInfo did not initialize info->pageScale,
|
||||||
|
info->xpages, info->ypages fix: in -_printPaginateWithInfo
|
||||||
|
set default pageScale=1.0 outside conditional fix: in -_print
|
||||||
|
set xpages and ypages from viewPageRange as reported by custom view.
|
||||||
|
* Source/NSView.m: -beginDocument was misplacing subviews when
|
||||||
|
generating PostScript for printing fix: force regeneration of
|
||||||
|
coordinates.
|
||||||
|
Patch Applied by Gregory Casamento
|
||||||
|
|
||||||
2006-10-15 Richard Frith-Macdonald <rfm@gnu.org>
|
2006-10-15 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/NSBrowser.m:
|
* Source/NSBrowser.m:
|
||||||
|
|
|
@ -451,7 +451,7 @@ enum {
|
||||||
[NSDecimalNumber decimalNumberWithString: @"1.0"]];
|
[NSDecimalNumber decimalNumberWithString: @"1.0"]];
|
||||||
|
|
||||||
[scaleFormatter setMaximum:
|
[scaleFormatter setMaximum:
|
||||||
[NSDecimalNumber decimalNumberWithString: @"100000.0"]];
|
[NSDecimalNumber decimalNumberWithString: @"1000.0"]];
|
||||||
|
|
||||||
[scaleFormatter setHasThousandSeparators: NO];
|
[scaleFormatter setHasThousandSeparators: NO];
|
||||||
[scaleTextField setFormatter: scaleFormatter];
|
[scaleTextField setFormatter: scaleFormatter];
|
||||||
|
@ -836,6 +836,10 @@ enum {
|
||||||
NSLog(@"NSPrintScalingFactor was nil in NSPrintInfo");
|
NSLog(@"NSPrintScalingFactor was nil in NSPrintInfo");
|
||||||
scaleNumber = [NSNumber numberWithFloat: 100.0];
|
scaleNumber = [NSNumber numberWithFloat: 100.0];
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
scaleNumber = [NSNumber numberWithDouble: (100.0*[scaleNumber doubleValue])];
|
||||||
|
}
|
||||||
|
|
||||||
[scaleTextField setObjectValue: scaleNumber];
|
[scaleTextField setObjectValue: scaleNumber];
|
||||||
|
|
||||||
|
@ -909,8 +913,8 @@ enum {
|
||||||
[_printInfo setOrientation: NSLandscapeOrientation];
|
[_printInfo setOrientation: NSLandscapeOrientation];
|
||||||
}
|
}
|
||||||
|
|
||||||
//Write scaling
|
//Write scaling and don't forget to convert from percent
|
||||||
scaleNumber = [NSNumber numberWithFloat: [scaleTextField floatValue]];
|
scaleNumber = [NSNumber numberWithDouble: [scaleTextField doubleValue]/100.0];
|
||||||
[[_printInfo dictionary] setObject: scaleNumber
|
[[_printInfo dictionary] setObject: scaleNumber
|
||||||
forKey: NSPrintScalingFactor];
|
forKey: NSPrintScalingFactor];
|
||||||
|
|
||||||
|
|
|
@ -734,11 +734,11 @@ scaleRect(NSRect rect, double scale)
|
||||||
|
|
||||||
/* Scale bounds by the user specified scaling */
|
/* Scale bounds by the user specified scaling */
|
||||||
info->scaledBounds = scaleRect(_rect, info->printScale);
|
info->scaledBounds = scaleRect(_rect, info->printScale);
|
||||||
|
info->pageScale = 1; // default
|
||||||
|
|
||||||
if (knowsRange == NO)
|
if (knowsRange == NO)
|
||||||
{
|
{
|
||||||
/* Now calculate page fitting to get page scale */
|
/* Now calculate page fitting to get page scale */
|
||||||
info->pageScale = 1;
|
|
||||||
if ([_printInfo horizontalPagination] == NSFitPagination)
|
if ([_printInfo horizontalPagination] == NSFitPagination)
|
||||||
info->pageScale = info->paperBounds.size.width
|
info->pageScale = info->paperBounds.size.width
|
||||||
/ NSWidth(info->scaledBounds);
|
/ NSWidth(info->scaledBounds);
|
||||||
|
@ -879,6 +879,12 @@ scaleRect(NSRect rect, double scale)
|
||||||
{
|
{
|
||||||
viewPageRange = NSMakeRange(1, (info.xpages * info.ypages));
|
viewPageRange = NSMakeRange(1, (info.xpages * info.ypages));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
info.xpages = 1;
|
||||||
|
info.ypages = viewPageRange.length;
|
||||||
|
}
|
||||||
|
|
||||||
[dict setObject: NSNUMBER(NSMaxRange(viewPageRange))
|
[dict setObject: NSNUMBER(NSMaxRange(viewPageRange))
|
||||||
forKey: @"NSPrintTotalPages"];
|
forKey: @"NSPrintTotalPages"];
|
||||||
if (allPages == YES)
|
if (allPages == YES)
|
||||||
|
|
|
@ -3826,7 +3826,7 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
||||||
|
|
||||||
[ctxt resetUsedFonts];
|
[ctxt resetUsedFonts];
|
||||||
/* Make sure we set the visible rect so everything is printed. */
|
/* Make sure we set the visible rect so everything is printed. */
|
||||||
[self _rebuildCoordinates];
|
[self _invalidateCoordinates];
|
||||||
_visibleRect = _bounds;
|
_visibleRect = _bounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue