Re: draw_polygon - possible code...

From: Date: Wed, 29 Aug 2001 20:09:13 +0000
Subject: Re: draw_polygon - possible code...
References: 1 2  Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-33@lists.php.net to get a copy of this message
Hi, On Wed, Aug 29, 2001 at 01:51:14PM -0500, Andrei Zmievski wrote : > On Wed, 29 Aug 2001, Alan Knowles wrote: > > had a look at draw_polygon - this version uses a array eg. > > (1,0,2,0,2,2,1,2) etc. to create the polygon.. > > - the overhead to create a 'point object' for 'x,y' seemed a bit > > much.. > > I guess it could also do > > > > ((1,0),(2,0),(2,2)).. > > > > note that there is no error checking on the array reading.. > > I think the code could be fitted into gen_types.php reasonably easily.. > > I am not quite sure if we should take this approach or just use GdkPoint > objects. This way may be a bit more efficient.. but.. What do others > think? I've checked some sources .. most of them never use GdkPoint natively and always construct an array of GdkPoint only to pass it to draw_polygon(). So, the use of a flat array is not only efficient but also the easiest way to use it. And .. if we really need it otherwise, implementing it is trivial. So, thats a +1 from me (but only with propery error checking!). - Markus

« previous php.gtk.dev (#33) next »