I have the code integrated into pgserver in CVS now. However, there are some
problems with clipping and scaling.
The filled polygon makes no attempt to implement clipping, so it will gladly
write anywhere on or off the screen. I also noticed that the ellipse and filled
ellipse do not implement clipping, they just use the default
rectangle-truncation that the rendering engine does.
The code snipped below illustrates the problems- resize it so that the shapes
should be cut off. The polygon will draw itself over the panelbar and the
ellipses will be squashed instead of cut.
Also, if you uncomment that pgSetMapping line, it will draw fine once, then
crash the next time you resize it. This is because the code to implement scaling
on the filled polygon modifies the polygon's array permanently to implement the
scaling.
Anyway, thanks for the patch Shane and hopefully we'll get it debugged soon :)
------8<------
#include <picogui.h>
int main(int argc, char **argv) {
pgcontext gc;
long arr[] = {
10,10,
50,50,
10,50,
50,10,
10,10
};
pgInit(argc,argv);
pgRegisterApp(PG_APP_NORMAL,"Polygon Test",0);
gc = pgNewCanvasContext(pgNewWidget(PG_WIDGET_CANVAS,0,0),PGFX_PERSISTENT);
// pgSetMapping(gc,0,0,60,60,PG_MAP_SCALE);
pgFPolygon(gc,pgNewArray(arr,sizeof(arr)/sizeof(long)));
pgEllipse(gc,60,10,40,40);
pgFEllipse(gc,110,10,40,40);
pgEventLoop();
return 0;
}
------>8------
Quoting Shane Nay <[EMAIL PROTECTED]>:
> Uh.., someone asked for this a long time ago :). Anyway, I reposted
> it on ftp, it's the same one that I sent as my "final" patch a long
> time ago. Anyway..., it's not forward ported, that will be left as
> an excercise to the reader :).
>
> (Though I may be convinced to forward port it myself, but I'm just
> not too happy with the way it's implemented in total)
>
> ftp://shane.mine.nu/pub/
>
> Thanks,
> Shane Nay.
>
> _______________________________________________
> Pgui-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/pgui-devel
>
--
Only you can prevent creeping featurism!
_______________________________________________
Pgui-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/pgui-devel