[fpc-pascal] Agg Pas Arcs

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Wed Aug 30 17:52:09 CEST 2017


On 2017-08-30 15:54, James Richters wrote:
> agg^.arc(Drawinfo.gi*pixelscale+Draw_X_offset,Drawinfo.gj*pixelscale+Draw_Y_offset,Drawinfo.r*pixelscale,Drawinfo.r*pixelscale,Drawinfo.ea,Drawinfo.sa);
> If Pixelscale drops below a certain point, the arc will not draw.   I ran several tests, then tried it with just hard coded values as follows:
> 
> agg^.arc(-600470.258096880350,168254.083748858280,624074.001867781300,624074.001867781300,6.011216001395,6.010880670454);


 From the above, it seems you implemented your own Arc() procedure. Is 
that correct?

 From the agg_2D.pas unit (the non GUI Toolkit dependent version), the 
Arc() implementation is as follows:

procedure Agg2D.arc(cx ,cy ,rx ,ry ,start ,sweep : double );
var
  ar: {bezier_}agg_arc.arc;
begin
   m_path.remove_all;
   ar.Construct(cx ,cy ,rx ,ry ,start ,sweep ,false );
   m_path.add_path(@ar ,0 ,false );
   drawPath(StrokeOnly );
end;

So I couldn't really test with your ARC example, but I could with your 
ArcTo() example. The latter indeed works. I also made each of the 3 arc 
segments in a different color - Red, Green and Blue to see exactly which 
is which.

Could you post the code for your Arc() implementation - seeing that your 
parameter list is totally different to mine.

ps:
   Unfortunately there are a couple of AggPas implementations floating
   around. The original version in not being maintained at all and should
   not be used any more, as it contains a few bugs and lacks 64-bit CPU
   support. My AggPas copy which lives in the fpGUI Toolkit code
   repository is well used and maintained. Could you try using my version
   of AggPas and see how that goes for you.

   If there is a bug in ARC, I would like to resolve it.

   You can get a copy of my AggPas from the fpGUI repository as shown
   here:

 
https://github.com/graemeg/fpGUI/tree/develop/src/corelib/render/software

Regards,
   Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shot.png
Type: image/png
Size: 4730 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20170830/a45108cb/attachment.png>


More information about the fpc-pascal mailing list