Fixed bugs in rectInMatrixSpace: and sizeInMatrixSpace:

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3676 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1999-02-09 12:34:32 +00:00
parent 50042c67ce
commit 5cf4300853

View file

@ -252,7 +252,11 @@ static const float pi = 3.1415926535897932384626433;
NSSize new;
new.width = A * size.width + C * size.height;
if (new.width < 0)
new.width = - new.width;
new.height = B * size.width + D * size.height;
if (new.height < 0)
new.height = - new.height;
return new;
}
@ -262,9 +266,20 @@ static const float pi = 3.1415926535897932384626433;
NSRect new;
new.origin.x = A * rect.origin.x + C * rect.origin.y + TX;
new.origin.y = B * rect.origin.x + D * rect.origin.y + TY;
new.size.width = A * rect.size.width + C * rect.size.height;
if (new.size.width < 0)
{
new.origin.x += new.size.width;
new.size.width *= -1;
}
new.origin.y = B * rect.origin.x + D * rect.origin.y + TY;
new.size.height = B * rect.size.width + D * rect.size.height;
if (new.size.height < 0)
{
new.origin.y += new.size.height;
new.size.height *= -1;
}
return new;
}