> Le 4 mars 2018 à 10:55, Jeffrey R. Carter <jrcar...@acm.org> a écrit :
> 
> I tried changing the body of 
> Gnoga.Gui.Element.Canvas.Context_2D.Plotting.Graph to
> 
>   procedure Graph (Plot  : in out Plot_Info;
>                    List  : in     Point_List;
>                    Color : in     Gnoga.Types.RGBA_Type := Black)
>   is
>      Context : Context_2D_Type;
>   begin -- Graph
>      if List'Length > 1 then
>         Context.Get_Drawing_Context_2D (Canvas => Plot);
>         Context.Begin_Path;
>         Context.Stroke_Color (Value => Color);
>         Context.Move_To (X => Plot.Scale_X (List (List'First).X),
>                          Y => Plot.Scale_Y (List (List'First).Y));
> 
>         All_Points : for I in List'First + 1 .. List'Last loop
> --              Plot.Line (From => List (I), To => List (I + 1), Color => 
> Color);
>            Context.Line_To (X => Plot.Scale_X (List (I).X),
>                             Y => Plot.Scale_Y (List (I).Y));
>         end loop All_Points;
> 
>         Context.Stroke;
>      end if;
>   end Graph;
> 
> in hopes that it would be faster than calling Line for each pair of points.
> Maybe it is a little faster, but in Plot_Test the call to Graph to plot the
> Mexican-hat function results in the screen remaining unchanged for several
> seconds, followed by the entire curve appearing. This feels at least as long 
> as
> drawing each segment individually, so I prefer the existing version which at
> least provides feedback that it's doing something. What do others think about 
> this?
> 
> -- 
> Jeff Carter
> "He didn't get that nose from playing ping-pong."
> Never Give a Sucker an Even Break
> 110
> 

Hello Jeff,

Have you tried to call the Stroke method inside the loop instead of calling it 
at the end?

HTH, Pascal.
http://blady.pagesperso-orange.fr



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list

Reply via email to