[cairo] cairo_new_sub_path: Making cairo_arc easier to use and more

Carl Worth cworth at cworth.org
Thu Feb 23 21:34:51 PST 2006


On Tue, 24 Jan 2006 12:27:14 -0800, Bill Spitzak wrote:
> 
> I'm thinking an implicit move_to is a bad idea. The reason is that you 
> may want to draw "dots" for any move_to that is not followed by another 
> move_to (or it already does this?).

We don't have a way to easily draw "dots" like this, but I've always
wanted one. I don't think we can do it with just move_to though. It's
often quite easy for people to call move_to multiple times and we
definitely don't want to start peppering the display with unwanted
dots for that.

Instead, I've imagined we could do dots for any *closed* degenerate
subpaths. That is, one get get dots by doing "move_to;
close_path". This would be most useful for drawing circular dots, (via
round joins), but could also do axis-aligned square dots for miter and
butt joins.

>                Also if the point is at the *start* of the closepath 
> segment, rather than at the join, this just sounds like a useless
> bug.

The current behavior does leave the current point at the join after
the close_path. So at this point, I still feel quite good about
close_path doing:

> So just to make it clear, I think close_path should be equivalent to:
> 
> 	1. line_to the original point
> 	2. secret stuff to make them mitre together into a loop
> 	3. new_sub_path

And I think we want to add:

	4. move_to the original point

In this case, if this behavior is undesired, at most the user has to
add an explicit new_sub_path after the close_path.

However, if we didn't do the move_to here, and that was not desired,
then the user would have to replicate all of cairo's
save-the-last-move-to-point state saving which can be quite annoying.

I'm convinced. I'll go shove this into a new-sub-path branch in my
personal cairo tree.

-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/20060223/790d21e3/attachment-0001.pgp


More information about the cairo mailing list