[cairo] dividing rectangles on vectoriel surface

kiwitargetgranule kiwitargetgranule at gmail.com
Mon Feb 20 16:28:24 PST 2012


i draw two dividing rectangles on a surface (i do not want to overlap them)
with the following code

#include <cairo/cairo-pdf.h>

int
main (void)
{
  cairo_surface_t *surface;
  cairo_t *cr;
  surface = cairo_pdf_surface_create ("cairo_test_fill.pdf", 40, 60);
  cr = cairo_create (surface);

  cairo_save (cr);
  cairo_translate (cr, 20, 20);
  cairo_rectangle (cr, -10, -10, 20, 20);
  cairo_fill (cr);
  cairo_restore (cr);

  cairo_save (cr);
  cairo_translate (cr, 20, 40);
  cairo_rectangle (cr, -10, -10, 20, 20);
  cairo_fill (cr);
  cairo_restore (cr);

  cairo_surface_write_to_png (surface, "cairo_test_fill.png");
  cairo_destroy (cr);
  cairo_surface_destroy (surface);
  return 0;
}

i see a dividing line between them on vectorial surface and not on image
surface
how can i fix the problem on the vectorial surface?
i suspect this is a device resolution dependent problem?
perhaps the rectangle API is a solution?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20120221/eb1fe732/attachment.htm>


More information about the cairo mailing list