[cairo] Re: cairo_get_current_point bug ?

Carl Worth cworth at cworth.org
Thu Sep 28 11:50:29 PDT 2006


On Fri, 22 Sep 2006 14:15:23 -0700, Bill Spitzak wrote:
> Behdad Esfahbod wrote:
>
> > Mike has a point.  We really want to keep the invariant that:
> >
> >   cairo_get_current_point (cr, &x0, &y0);
> >   cairo_translate (cr, x1, y1);
> >   cairo_get_current_point (cr, &x2, &y2);
> >   assert (x0 == x1 + x2 && y0 == y1 + y2);
>
> Whoa! Good point! I retract my previous statement that having the 0,0 be
>   in user space is a good idea.

I'm still not sure that I'm convinced of this.

I forgot to mention it in the mail I just sent with the
no-current-point patchset, but it argues for the user-space origin
being returned from cairo_get_current_point in this case, (since an
implicit move_to (0, 0) is really the only sensible thing to add to
make the relative path-construction functions not yield an error).

Meanwhile, the discussion is about what value to provide when we know
that there is no well-defined value whatsoever. So that's silly to even
talk about, but I would argue that it's definitely better to return a
"nothing" value rather than something that pretends to have some
meaning.

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060928/58c1f17c/attachment-0001.pgp


More information about the cairo mailing list