summaryrefslogtreecommitdiff
path: root/src/corelib/gdi
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-11-06 09:08:28 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-11-06 09:08:28 +0000
commit5bf8e89254b2316be9fb701825b16e45807e394a (patch)
treef16038d1dbc34aee6ca8a4cc997420bed993dc7e /src/corelib/gdi
parenta86c82aa5b3aea8a4cb40a9fa1121427bf320bfd (diff)
downloadfpGUI-5bf8e89254b2316be9fb701825b16e45807e394a.tar.xz
* Applied patch from Giuliano Colla. It modifies the line drawing but is currently a workaround for a bug.
Diffstat (limited to 'src/corelib/gdi')
-rw-r--r--src/corelib/gdi/gfx_gdi.pas10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/corelib/gdi/gfx_gdi.pas b/src/corelib/gdi/gfx_gdi.pas
index 921c0b1e..6c190a90 100644
--- a/src/corelib/gdi/gfx_gdi.pas
+++ b/src/corelib/gdi/gfx_gdi.pas
@@ -1294,6 +1294,11 @@ procedure TfpgCanvasImpl.DoDrawArc(x, y, w, h: TfpgCoord; a1, a2: Extended);
var
SX, SY, EX, EY: Longint;
begin
+ {Stupid GDI can't tell the difference between 0 and 360°!!}
+ if a2 = 0 then exit;
+ {Stupid GDI must be told in which direction to draw}
+ if a2 < 0 then Windows.SetArcDirection(FGc,AD_CLOCKWISE)
+ else Windows.SetArcDirection(FGc,AD_COUNTERCLOCKWISE);
Angles2Coords(x, y, w, h, a1*16, a2*16, SX, SY, EX, EY);
{$IFNDEF wince}
Windows.Arc(Fgc, x, y, x+w, y+h, SX, SY, EX, EY);
@@ -1304,6 +1309,11 @@ procedure TfpgCanvasImpl.DoFillArc(x, y, w, h: TfpgCoord; a1, a2: Extended);
var
SX, SY, EX, EY: Longint;
begin
+ {Stupid GDI can't tell the difference between 0 and 360°!!}
+ if a2 = 0 then exit;
+ {Stupid GDI must be told in which direction to draw}
+ if a2 < 0 then Windows.SetArcDirection(FGc,AD_CLOCKWISE)
+ else Windows.SetArcDirection(FGc,AD_COUNTERCLOCKWISE);
Angles2Coords(x, y, w, h, a1*16, a2*16, SX, SY, EX, EY);
{$IFNDEF wince}
Windows.Pie(Fgc, x, y, x+w, y+h, SX, SY, EX, EY);