[Drawkit] Handling full circles with DKArcPath
Graham Cox
graham.cox at bigpond.com
Fri Oct 17 16:51:49 PDT 2008
On 16 Oct 2008, at 9:09 pm, Alastair Houghton wrote:
> A better approach to solving this problem would be to alter the code
> that handles interaction with the user so that it keeps track of
> what they're actually doing with the end angle. That way you can
> make arbitrarily small arcs *and* full circles without having
> problems where one turns into the other unexpectedly.
Yes, I agree this would be better behaviour.
I'll take a look at this - I'm thinking that simply setting a max
angle limit of 360 and not wrapping to 0 should work, rather that
trying to detect clockwise or anti-clockwise rotation which could be
gnarly.
Note that if you want a circle and only a circle, you can set the
arcType to kDKArcPathCircle and that's what you get, though using the
arc's interactive dragging behaviours. Depending on your needs that
can be a better choice than an ordinary shape with a circular path,
since that is readily distorted into an oval, etc whereas the arc
implementation is a circle and always will be a circle no matter what
you do to it.
cheers, Graham
More information about the Drawkit
mailing list