mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 17:52:42 +00:00
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:
parent
50042c67ce
commit
5cf4300853
1 changed files with 16 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue