mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 03:30:48 +00:00
Small error corrections for printing.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24971 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
82247728ad
commit
e3a40d5811
4 changed files with 104 additions and 104 deletions
|
@ -1,3 +1,11 @@
|
|||
2007-04-10 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSClipView.m (-setBoundsOrigin:): Use NSView method
|
||||
scrollRect:by:.
|
||||
* Source/NSPrintOperation.m (NSView
|
||||
-_displayPageInRect:atPlacement:withInfo:): Release the temporary matrixes.
|
||||
* Source/GSEPSPrintOperation.m (_print): Call endPage on the view.
|
||||
|
||||
2007-04-05 Xavier Glattard <xavier.glattard@online.fr>
|
||||
|
||||
* Headers/AppKit/NSAnimation.h
|
||||
|
|
|
@ -102,11 +102,12 @@
|
|||
forKey: @"NSPrintSheetBounds"];
|
||||
|
||||
[_view beginDocument];
|
||||
|
||||
[_view beginPageInRect: _rect
|
||||
atPlacement: NSMakePoint(0,0)];
|
||||
|
||||
[_view displayRectIgnoringOpacity: _rect];
|
||||
|
||||
[_view endPage];
|
||||
[_view endDocument];
|
||||
}
|
||||
|
||||
|
@ -123,7 +124,7 @@
|
|||
|
||||
eps = [NSString stringWithContentsOfFile: _path];
|
||||
|
||||
[_data setData: [eps dataUsingEncoding:NSASCIIStringEncoding]];
|
||||
[_data setData: [eps dataUsingEncoding: NSASCIIStringEncoding]];
|
||||
}
|
||||
|
||||
return YES;
|
||||
|
|
|
@ -280,36 +280,25 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
|
|||
}
|
||||
else
|
||||
{
|
||||
/* Copy the intersection to the new position */
|
||||
NSPoint destPoint = intersection.origin;
|
||||
float dx = newBounds.origin.x - originalBounds.origin.x;
|
||||
float dy = newBounds.origin.y - originalBounds.origin.y;
|
||||
NSRect redrawRect;
|
||||
|
||||
/* It is assumed these dx and dy will be integer in device
|
||||
space because they are the difference of the bounds
|
||||
origins, both of which should be integers in device space
|
||||
because of the code at the end of
|
||||
constrainScrollPoint:. */
|
||||
destPoint.x -= dx;
|
||||
destPoint.y -= dy;
|
||||
float dx = newBounds.origin.x - originalBounds.origin.x;
|
||||
float dy = newBounds.origin.y - originalBounds.origin.y;
|
||||
NSRect redrawRect;
|
||||
|
||||
/* Now copy ! */
|
||||
[self lockFocus];
|
||||
/* NB: Because of all the previous comments, we are sure the
|
||||
following is copying an integer rectangle by an integer
|
||||
amount (`integer' in device space) - which should cause
|
||||
no problems */
|
||||
NSCopyBits (0, intersection, destPoint);
|
||||
[self unlockFocus];
|
||||
/* Copy the intersection to the new position */
|
||||
[self scrollRect: intersection by: NSMakeSize(dx, dy)];
|
||||
|
||||
/* Change coordinate system to the new one */
|
||||
[super setBoundsOrigin: newBounds.origin];
|
||||
|
||||
/* Get the rectangle representing intersection in the new
|
||||
bounds (mainly to keep code readable) */
|
||||
intersection.origin.x = destPoint.x;
|
||||
intersection.origin.y = destPoint.y;
|
||||
intersection.origin.x -= dx;
|
||||
intersection.origin.y -= dy;
|
||||
// intersection.size is the same
|
||||
|
||||
/* Now mark everything which is outside intersection as
|
||||
|
@ -319,10 +308,10 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
|
|||
rects will be non-empty. */
|
||||
|
||||
/* To the left of intersection */
|
||||
redrawRect = NSMakeRect (NSMinX (_bounds), _bounds.origin.y,
|
||||
NSMinX (intersection) - NSMinX (_bounds),
|
||||
redrawRect = NSMakeRect(NSMinX(_bounds), _bounds.origin.y,
|
||||
NSMinX(intersection) - NSMinX(_bounds),
|
||||
_bounds.size.height);
|
||||
if (NSIsEmptyRect (redrawRect) == NO)
|
||||
if (NSIsEmptyRect(redrawRect) == NO)
|
||||
{
|
||||
[_documentView setNeedsDisplayInRect:
|
||||
[self convertRect: redrawRect
|
||||
|
@ -330,10 +319,10 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
|
|||
}
|
||||
|
||||
/* Right */
|
||||
redrawRect = NSMakeRect (NSMaxX (intersection), _bounds.origin.y,
|
||||
NSMaxX (_bounds) - NSMaxX (intersection),
|
||||
redrawRect = NSMakeRect(NSMaxX(intersection), _bounds.origin.y,
|
||||
NSMaxX(_bounds) - NSMaxX(intersection),
|
||||
_bounds.size.height);
|
||||
if (NSIsEmptyRect (redrawRect) == NO)
|
||||
if (NSIsEmptyRect(redrawRect) == NO)
|
||||
{
|
||||
[_documentView setNeedsDisplayInRect:
|
||||
[self convertRect: redrawRect
|
||||
|
@ -341,10 +330,10 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
|
|||
}
|
||||
|
||||
/* Up (or Down according to whether it's flipped or not) */
|
||||
redrawRect = NSMakeRect (_bounds.origin.x, NSMinY (_bounds),
|
||||
redrawRect = NSMakeRect(_bounds.origin.x, NSMinY(_bounds),
|
||||
_bounds.size.width,
|
||||
NSMinY (intersection) - NSMinY (_bounds));
|
||||
if (NSIsEmptyRect (redrawRect) == NO)
|
||||
NSMinY(intersection) - NSMinY(_bounds));
|
||||
if (NSIsEmptyRect(redrawRect) == NO)
|
||||
{
|
||||
[_documentView setNeedsDisplayInRect:
|
||||
[self convertRect: redrawRect
|
||||
|
@ -352,10 +341,10 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
|
|||
}
|
||||
|
||||
/* Down (or Up) */
|
||||
redrawRect = NSMakeRect (_bounds.origin.x, NSMaxY (intersection),
|
||||
redrawRect = NSMakeRect(_bounds.origin.x, NSMaxY(intersection),
|
||||
_bounds.size.width,
|
||||
NSMaxY (_bounds) - NSMaxY (intersection));
|
||||
if (NSIsEmptyRect (redrawRect) == NO)
|
||||
NSMaxY(_bounds) - NSMaxY(intersection));
|
||||
if (NSIsEmptyRect(redrawRect) == NO)
|
||||
{
|
||||
[_documentView setNeedsDisplayInRect:
|
||||
[self convertRect: redrawRect
|
||||
|
|
|
@ -1098,9 +1098,9 @@ scaleRect(NSRect rect, double scale)
|
|||
{
|
||||
NSAffineTransformStruct ats = { 1, 0, 0, -1, 0, NSHeight(_bounds) };
|
||||
NSAffineTransform *matrix, *flip;
|
||||
|
||||
flip = [NSAffineTransform new];
|
||||
matrix = [NSAffineTransform new];
|
||||
[matrix makeIdentityMatrix];
|
||||
[matrix prependTransform: _boundsMatrix];
|
||||
/*
|
||||
* The flipping process must result in a coordinate system that
|
||||
|
@ -1110,6 +1110,8 @@ scaleRect(NSRect rect, double scale)
|
|||
[flip setTransformStruct: ats];
|
||||
[matrix prependTransform: flip];
|
||||
[matrix concat];
|
||||
RELEASE(flip);
|
||||
RELEASE(matrix);
|
||||
yoffset = NSHeight(_frame) - NSMaxY(pageRect);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue