[cairo] cairo_in_fill on boundaries broken?

Benjamin Otte otte at gnome.org
Fri Apr 18 14:38:10 PDT 2008


Hey,

while writing tests for Swfdec I found that the following code behaves
unexpected:

#include <cairo.h>
#include <stdio.h>

int
main ()
{
  cairo_surface_t *surface = cairo_image_surface_create
(CAIRO_FORMAT_ARGB32, 1, 1);
  cairo_t *cr = cairo_create (surface);

  cairo_rectangle (cr, 0, 0, 10, 10);
  printf ("%s\n", cairo_in_fill (cr, 0, 0) ? "yes" : "no");
  printf ("%s\n", cairo_in_fill (cr, 10, 10) ? "yes" : "no");

  return 0;
}

I would have expected it to print "yes" in the first case and "no" in
the second case, but it turns out it's the opposite behavior. So I'm
wondering: Is the behavior of cairo_in_fill on boundaries supposed to
be this way, is this a bug or is the behavior undefined and might
change in the future?
Please be aware that in this case I'm wondering about there are no
rounding problems, so that is not the problem.

Cheers,
Benjamin


More information about the cairo mailing list