summaryrefslogtreecommitdiff
path: root/src/corelib
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2012-03-12 01:55:10 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2012-03-12 01:55:10 +0200
commit74eeab6c39869844e65e7c63a4e094e669636431 (patch)
tree09e97b4cf33c2676a63aabcb859dec0f1252b129 /src/corelib
parent505cc8c331840d36245f3b2e30aac63393298ad8 (diff)
downloadfpGUI-74eeab6c39869844e65e7c63a4e094e669636431.tar.xz
aggpas: signature of Line() method changed.
* Some parameters are now declared as const * Added a new AFixAlignment parameter. This is used when drawing vertical or horizontal lines, where the anti-aliasing doesn't give desired "visual" results. The AGG documentation explains the behaviour in great detail.
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/render/software/Agg2D.pas20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/corelib/render/software/Agg2D.pas b/src/corelib/render/software/Agg2D.pas
index 19b9009b..17faf904 100644
--- a/src/corelib/render/software/Agg2D.pas
+++ b/src/corelib/render/software/Agg2D.pas
@@ -427,7 +427,7 @@ type
function InBox(worldX ,worldY : double ) : boolean;
// Basic Shapes
- procedure Line (x1 ,y1 ,x2 ,y2 : double );
+ procedure Line(const x1, y1, x2, y2: double; AFixAlignment: boolean = false );
procedure Triangle (const x1 ,y1 ,x2 ,y2 ,x3 ,y3 : double );
procedure Rectangle(const x1 ,y1 ,x2 ,y2 : double );
@@ -2268,13 +2268,25 @@ begin
end;
{ LINE }
-procedure TAgg2D.Line(x1 ,y1 ,x2 ,y2 : double );
+procedure TAgg2D.Line(const x1, y1, x2, y2: double; AFixAlignment: boolean = false);
+var
+ lx1, ly1, lx2, ly2: double;
begin
m_path.remove_all;
- addLine (x1 ,y1 ,x2 ,y2 );
- DrawPath(AGG_StrokeOnly );
+ lx1 := x1;
+ ly1 := y1;
+ lx2 := x2;
+ ly2 := y2;
+
+ if AFixAlignment then
+ begin
+ AlignPoint(@lx1, @ly1);
+ AlignPoint(@lx2, @ly2);
+ end;
+ addLine(lx1, ly1, lx2, ly2);
+ DrawPath(AGG_StrokeOnly );
end;
{ TRIANGLE }