[cairo] big point handling

Kouhei Sutou kou at cozmixng.org
Tue Jun 12 05:12:33 PDT 2007


Hi,

The following program doesn't show anything:

#include <cairo.h>

int
main(int argc, char **argv)
{
    cairo_t *cr;
    cairo_surface_t *surface;

    surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 100, 100);
    cr = cairo_create(surface);
    cairo_surface_destroy(surface);

    cairo_move_to(cr, 0, 0);
    /* cairo_line_to(cr, 32766, 32766); */ /* OK */
    cairo_line_to(cr, 32767, 32767); /* NG */
    cairo_stroke(cr);

    cairo_surface_write_to_png(surface, "big-point.png");

    cairo_destroy(cr);

    return 0;
}

But using '/* OK */' line instead of '/* NG */' line shows a
line from top left to bottom right.

_cairo_fixed_from_double may cause overflow(?) for 32767. I
think it's better that cairo tells us overflow(?) by
returning something cairo_status_t.


Thanks,
--
kou


More information about the cairo mailing list