On Fri, 3 Aug 2007 21:23:13 +0200 Mattia Barbon <[EMAIL PROTECTED]> wrote:
Hi again, > On Wed, 01 Aug 2007 18:07:07 +1200 > Klaas Hartmann <[EMAIL PROTECTED]> wrote: > I have applied the patch, but I see some (easily fixed) issues: > - where you use wxPli_av_2_wxPoint2DDouble, you must free the > allocated array (like in wxDC::DrawPolygon). Since changing the way the meory is managed in wxDC::DrawPolygon has been one of my long-standing itches, I just changed that and also fixed the memory management in wxGraphicsContext. > - MIN(n,wxPli_av_2_wxPoint2DDouble(aTHX_ endPoints, &endPoints2d)) > I do not think MIN is a standard macro; and being a macro, it > evaluates wxPli_av_2_wxPoint2DDouble twice; you can use the > wxMin macro (but the caveat about double-evaluation still applies) > - #including <wx/graphics.h> outside #if wxUSE_GRAPHICS_CONTEXT > breaks compilation with old wxWidgets versions (fixed in SVN) > > There are three functions that require a wxPoint2DDouble (the rest have > > overloaded alternatives) and these require an array of points. The perl > > interface I have used here uses an array ref of points instead. These are > > of > > the format [x1,y1,x2,y2,x3,y3]. Let me know what you think of this > > approach, > > it is easy enough to change -- before anyone other than me starts using it! > > I'd rather have the array be of the form > [ $p1, $p2, $p3 ] where $px is a [$x, $y] array (or a point object). > I believe it is more common to have an array of points rather than > a flat list. It's also consistent with other wxWidgets/wxPerl functions. And I went ahead fixing the rest of the issues I had with wxGraphicsContext. Looking forward for patches for the rest of the API :-) Regards, Mattia
