[cairo] plots of contiguous rectangles

Behdad Esfahbod behdad at behdad.org
Wed Aug 8 16:01:09 PDT 2007


On Wed, 2007-08-08 at 14:09 -0400, Bill Baxter wrote:
> So Cairo doesn't have any way to render water-tight meshes?
> Do GDI+ and Quartz punt on that too?

Well, if you know what you are doing, you may be able to get away using
CAIRO_OPERATOR_ADD.

behdad

> --bb
> 
> On 8/9/07, Carl Worth <cworth at cworth.org> wrote:
> > On Wed, 8 Aug 2007 18:50:16 +0200, Tamas K Papp wrote:
> > >
> > > How could I get rid of both?
> >
> > Snapping to device-space integers is what I would recommend.
> >
> > Something like:
> >
> >         void
> >         snap_point (cairo_t *cr, double *x, double *y)
> >         {
> >             cairo_user_to_device (cr, x, y);
> >             *x = round (*x);
> >             *y = round (*y);
> >             cairo_device_to_user (cr, x, y);
> >         }
> >
> >         snap_point (cr, &x1, &y1);
> >         snap_point (cr, &x2, &y2);
> >
> >         cairo_rectangle (cr, x1, y2, x2 - x1, y2 - y2);
> >
> > >                              Snapping to integer grids is something I
> > > want to avoid: I am drawing on vector and bitmap surfaces, and I would
> > > have to keep tack of which is which.  But if there is not other
> > > solution, I can try to manage that, I just need to know.
> >
> >
> > Even if you didn't distinguish between vector and bitmap surfaces,
> > (which I can understand your reluctance to do), the device-space grid
> > for a vector surface such as PostScript or PDF will be 1 device-space
> > unit == 1 point (1/72 inch). Would a maximum error of half of 1/144
> > inch be a noticeable problem?
> >
> > -Carl
> >
> > _______________________________________________
> > cairo mailing list
> > cairo at cairographics.org
> > http://lists.cairographics.org/mailman/listinfo/cairo
> >
> >
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
-- 
behdad
http://behdad.org/

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759





More information about the cairo mailing list