mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 15:11:37 +00:00
simplify by removing low level code
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24929 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d00b0fcb89
commit
efa7803d40
2 changed files with 13 additions and 21 deletions
|
@ -1,3 +1,7 @@
|
|||
2007-03-23 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSAffineTransform.m: Simplify code slightly.
|
||||
|
||||
2007-03-23 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSCell.m (-drawWithFrame:inView:): Extract helper methods
|
||||
|
|
|
@ -58,24 +58,6 @@
|
|||
|
||||
static const float pi = 3.1415926535897932384626434;
|
||||
|
||||
/* Quick function to multiply two coordinate matrices. C = AB */
|
||||
static inline NSAffineTransformStruct
|
||||
matrix_multiply (NSAffineTransformStruct MA, NSAffineTransformStruct MB)
|
||||
{
|
||||
NSAffineTransformStruct MC;
|
||||
MC.m11 = MA.m11 * MB.m11 + MA.m12 * MB.m21;
|
||||
MC.m12 = MA.m11 * MB.m12 + MA.m12 * MB.m22;
|
||||
MC.m21 = MA.m21 * MB.m11 + MA.m22 * MB.m21;
|
||||
MC.m22 = MA.m21 * MB.m12 + MA.m22 * MB.m22;
|
||||
MC.tX = MA.tX * MB.m11 + MA.tY * MB.m21 + MB.tX;
|
||||
MC.tY = MA.tX * MB.m12 + MA.tY * MB.m22 + MB.tY;
|
||||
return MC;
|
||||
}
|
||||
|
||||
static NSAffineTransformStruct identityTransform = {
|
||||
1.0, 0.0, 0.0, 1.0, 0.0, 0.0
|
||||
};
|
||||
|
||||
@implementation NSAffineTransform (GUIAdditions)
|
||||
|
||||
/**
|
||||
|
@ -154,6 +136,10 @@ static NSAffineTransformStruct identityTransform = {
|
|||
|
||||
- (void) makeIdentityMatrix
|
||||
{
|
||||
static NSAffineTransformStruct identityTransform = {
|
||||
1.0, 0.0, 0.0, 1.0, 0.0, 0.0
|
||||
};
|
||||
|
||||
[self setTransformStruct: identityTransform];
|
||||
}
|
||||
|
||||
|
@ -190,8 +176,8 @@ static NSAffineTransformStruct identityTransform = {
|
|||
|
||||
- (void) concatenateWithMatrix: (const float[6])anotherMatrix
|
||||
{
|
||||
NSAffineTransformStruct matrix = [self transformStruct];
|
||||
NSAffineTransformStruct amat;
|
||||
NSAffineTransform *other;
|
||||
|
||||
GSOnceMLog(@"deprecated ... use -prependTransform:");
|
||||
amat.m11 = anotherMatrix[0];
|
||||
|
@ -200,8 +186,10 @@ static NSAffineTransformStruct identityTransform = {
|
|||
amat.m22 = anotherMatrix[3];
|
||||
amat.tX = anotherMatrix[4];
|
||||
amat.tY = anotherMatrix[5];
|
||||
matrix = matrix_multiply(amat, matrix);
|
||||
[self setTransformStruct: matrix];
|
||||
other = [NSAffineTransform new];
|
||||
[other setTransformStruct: amat];
|
||||
[self prependTransform: other];
|
||||
RELEASE(other);
|
||||
}
|
||||
|
||||
- (void)inverse
|
||||
|
|
Loading…
Reference in a new issue