mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
Correct the geometry computation.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28876 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
054405e8f3
commit
903ace2b7e
2 changed files with 7 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
2009-10-25 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSGradient.m (-drawInRect:angle:): Correct the math by
|
||||
adding a call to abs().
|
||||
|
||||
2009-10-23 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Headers/AppKit/NSGraphicsContext.h,
|
||||
|
|
|
@ -112,7 +112,6 @@
|
|||
angle -= 360.0;
|
||||
}
|
||||
|
||||
rad = PI * angle / 180;
|
||||
if (angle < 90.0)
|
||||
{
|
||||
startPoint = NSMakePoint(NSMinX(rect), NSMinY(rect));
|
||||
|
@ -129,7 +128,8 @@
|
|||
{
|
||||
startPoint = NSMakePoint(NSMinX(rect), NSMaxY(rect));
|
||||
}
|
||||
length = NSWidth(rect) * cos(rad) + NSHeight(rect) * sin(rad);
|
||||
rad = PI * angle / 180;
|
||||
length = abs(NSWidth(rect) * cos(rad) + NSHeight(rect) * sin(rad));
|
||||
endPoint = NSMakePoint(startPoint.x + length * cos(rad),
|
||||
startPoint.y + length * sin(rad));
|
||||
|
||||
|
|
Loading…
Reference in a new issue