Exchanged appendTransform: and prePendTransform:

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18479 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
FredKiefer 2004-01-25 16:50:33 +00:00
parent 3083c7c0f6
commit f3292b3044
4 changed files with 32 additions and 23 deletions

View file

@ -1,3 +1,12 @@
2004-01-25 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSAffineTransform.m: Exchanged the code of
appendTransform: and prePendTransform: to be Cocoa compatibile.
(-concatenateWith:) replaced appendTransform: with prependTransform:.
* Source/NSPrintOperation.m: (NSView
-_displayPageInRect:atPlacement:withInfo:) Item.
* Source/NSView.m (+initialize, -_rebuildCoordinates) Item.
2004-01-25 16:16 Alexander Malmberg <alexander@malmberg.org> 2004-01-25 16:16 Alexander Malmberg <alexander@malmberg.org>
* Source/NSStringDrawing.m: Big redesign. * Source/NSStringDrawing.m: Big redesign.

View file

@ -96,12 +96,12 @@ static NSAffineTransformStruct identityTransform = {
{ {
float newA, newB, newC, newD, newTX, newTY; float newA, newB, newC, newD, newTX, newTY;
newA = aTransform->A * A + aTransform->B * C; newA = A * aTransform->A + B * aTransform->C;
newB = aTransform->A * B + aTransform->B * D; newB = A * aTransform->B + B * aTransform->D;
newC = aTransform->C * A + aTransform->D * C; newC = C * aTransform->A + D * aTransform->C;
newD = aTransform->C * B + aTransform->D * D; newD = C * aTransform->B + D * aTransform->D;
newTX = aTransform->TX * A + aTransform->TY * C + TX; newTX = TX * aTransform->A + TY * aTransform->C + aTransform->TX;
newTY = aTransform->TX * B + aTransform->TY * D + TY; newTY = TX * aTransform->B + TY * aTransform->D + aTransform->TY;
A = newA; B = newB; A = newA; B = newB;
C = newC; D = newD; C = newC; D = newD;
@ -182,12 +182,12 @@ static NSAffineTransformStruct identityTransform = {
{ {
float newA, newB, newC, newD, newTX, newTY; float newA, newB, newC, newD, newTX, newTY;
newA = A * aTransform->A + B * aTransform->C; newA = aTransform->A * A + aTransform->B * C;
newB = A * aTransform->B + B * aTransform->D; newB = aTransform->A * B + aTransform->B * D;
newC = C * aTransform->A + D * aTransform->C; newC = aTransform->C * A + aTransform->D * C;
newD = C * aTransform->B + D * aTransform->D; newD = aTransform->C * B + aTransform->D * D;
newTX = TX * aTransform->A + TY * aTransform->C + aTransform->TX; newTX = aTransform->TX * A + aTransform->TY * C + TX;
newTY = TX * aTransform->B + TY * aTransform->D + aTransform->TY; newTY = aTransform->TX * B + aTransform->TY * D + TY;
A = newA; B = newB; A = newA; B = newB;
C = newC; D = newD; C = newC; D = newD;
@ -444,7 +444,7 @@ static NSAffineTransformStruct identityTransform = {
- (void) concatenateWith: (NSAffineTransform*)anotherMatrix - (void) concatenateWith: (NSAffineTransform*)anotherMatrix
{ {
[self appendTransform: anotherMatrix]; [self prependTransform: anotherMatrix];
} }
- (void) concatenateWithMatrix: (const float[6])anotherMatrix - (void) concatenateWithMatrix: (const float[6])anotherMatrix

View file

@ -1062,14 +1062,14 @@ scaleRect(NSRect rect, double scale)
flip = [NSAffineTransform new]; flip = [NSAffineTransform new];
matrix = [NSAffineTransform new]; matrix = [NSAffineTransform new];
[matrix makeIdentityMatrix]; [matrix makeIdentityMatrix];
[matrix appendTransform: _boundsMatrix]; [matrix prependTransform: _boundsMatrix];
/* /*
* The flipping process must result in a coordinate system that * The flipping process must result in a coordinate system that
* exactly overlays the original. To do that, we must translate * exactly overlays the original. To do that, we must translate
* the origin by the height of the view. * the origin by the height of the view.
*/ */
[flip setTransformStruct: ats]; [flip setTransformStruct: ats];
[matrix appendTransform: flip]; [matrix prependTransform: flip];
[matrix concat]; [matrix concat];
yoffset = NSHeight(_frame) - NSMaxY(pageRect); yoffset = NSHeight(_frame) - NSMaxY(pageRect);
} }

View file

@ -125,10 +125,10 @@ static NSAffineTransform *flip = nil;
static NSNotificationCenter *nc = nil; static NSNotificationCenter *nc = nil;
static SEL appSel; static SEL preSel;
static SEL invalidateSel; static SEL invalidateSel;
static void (*appImp)(NSAffineTransform*, SEL, NSAffineTransform*); static void (*preImp)(NSAffineTransform*, SEL, NSAffineTransform*);
static void (*invalidateImp)(NSView*, SEL); static void (*invalidateImp)(NSView*, SEL);
/* /*
@ -211,11 +211,11 @@ GSSetDragTypes(NSView* obj, NSArray *types)
NSObjectMapValueCallBacks, 0); NSObjectMapValueCallBacks, 0);
typesLock = [NSLock new]; typesLock = [NSLock new];
appSel = @selector(appendTransform:); preSel = @selector(prependTransform:);
invalidateSel = @selector(_invalidateCoordinates); invalidateSel = @selector(_invalidateCoordinates);
appImp = (void (*)(NSAffineTransform*, SEL, NSAffineTransform*)) preImp = (void (*)(NSAffineTransform*, SEL, NSAffineTransform*))
[matrixClass instanceMethodForSelector: appSel]; [matrixClass instanceMethodForSelector: preSel];
invalidateImp = (void (*)(NSView*, SEL)) invalidateImp = (void (*)(NSView*, SEL))
[self instanceMethodForSelector: invalidateSel]; [self instanceMethodForSelector: invalidateSel];
@ -3988,7 +3988,7 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
NSAffineTransform *pMatrix = [_super_view _matrixToWindow]; NSAffineTransform *pMatrix = [_super_view _matrixToWindow];
[_matrixToWindow takeMatrixFromTransform: pMatrix]; [_matrixToWindow takeMatrixFromTransform: pMatrix];
(*appImp)(_matrixToWindow, appSel, _frameMatrix); (*preImp)(_matrixToWindow, preSel, _frameMatrix);
if (_rFlags.flipped_view != wasFlipped) if (_rFlags.flipped_view != wasFlipped)
{ {
/* /*
@ -3997,9 +3997,9 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
* the origin by the height of the view. * the origin by the height of the view.
*/ */
flip->matrix.tY = _frame.size.height; flip->matrix.tY = _frame.size.height;
(*appImp)(_matrixToWindow, appSel, flip); (*preImp)(_matrixToWindow, preSel, flip);
} }
(*appImp)(_matrixToWindow, appSel, _boundsMatrix); (*preImp)(_matrixToWindow, preSel, _boundsMatrix);
[_matrixFromWindow takeMatrixFromTransform: _matrixToWindow]; [_matrixFromWindow takeMatrixFromTransform: _matrixToWindow];
[_matrixFromWindow invert]; [_matrixFromWindow invert];