[GRASS5] Polygons slow when zoomed in

Radim Blazek blazek at itc.it
Wed May 19 08:14:00 EDT 2004


On Wednesday 19 May 2004 12:46, Jens Oberender wrote:
> Hi
>
> > I think I know why it is slow, I could reproduce it.
> > When coordinates of the polygon are recalculated from map units to
> > display (canvas) units it may happen (if you zoom out) that some values
> > overflow integer maximum value. Result in the display is (known) mess:
> > http://mpa.itc.it/radim/qgis/poly-zoom-out.png (should be only filled by
> > blue)
> >
> > I guess that this also makes rendering (on X side) slow, because X has to
> > render very complex (wrong, more or less random) polygons.
> >
> > Just now, I don't know how to solve this, because any pre-clipping would
> > be slow? Anybody has idea?
>
> I hope it doesn't sound dumb but why not use doubles instead of integer to
> circumvent this? It would need much more memory but we are on the save side
> then.

XFillPolygon(display, d, gc, points, npoints, shape, mode)
             Display *display;
             Drawable d;
             GC gc;
             XPoint *points;
             int npoints;
             int shape;
             int mode;

typedef struct {
     short x, y;
} XPoint;

So not integer, only short.

Radim




More information about the grass-dev mailing list