[Drawkit] Questions on control knobs
Brad Larson
larson at sonoplot.com
Thu Jun 26 15:27:19 PDT 2008
On Jun 25, 2008, at 8:22 PM, Graham Cox wrote:
>
> On 26 Jun 2008, at 6:32 am, Brad Larson wrote:
>> I like your implementation of the 80% radius control point better
>> than than just using the center (0% radius), it's a lot easier to
>> line up and size an arc that way.
>
> I've actually moved it to be 100% (on the arc itself) which has the
> advantage of tracking the mouse more accurately. There's probably a
> case here for using a custom DKKnob appearance (or adding a new
> style to the existing knob class) that unambiguously indicates the
> knob's function. Also, by angling the knobs to match the local
> angle, they look better and have a more obvious function.
The final arc control design is really slick. I don't know that I've
worked with a vector drawing program that did as good a job as what
you have now.
> I plan to include this in DK for the next release since now I see it
> in use there's no doubt it's a very useful shape type.
>
I agree, it is a very nice implementation of a common shape.
There's just one issue I have with the current implementation, and
that's when you are drawing the arc it currently uses a stroke width
of 2.0 for the initial radius line. At the high magnifications that
we're dealing with, that becomes enormous. For someone who is zoomed
out, it might also present a problem. This could be fixed by copying
the current style and changing its color to make the temporary stroke
style used at the beginning of DKArcPath's arcCreateLoop: method,
rather than generating it from scratch using the
styleWithFillColour:strokeColour:strokeWidth: method as is done now.
This should be simple, but I can't figure out an easy way to reach
into a DKStyle and address its DKStroke so that I can set the
DKStroke's properties.
Additionally, I have one last shape (source attached) that is simply a
point. We use it to represent a single droplet put down by our
dispenser, so it's a very simple object that can't be resized, only
placed on the drawing and moved. Internally, its path just consists
of a MoveTo the center of the point and a LineTo the same center
point. We use a feature style that has rounded endcaps and is as wide
as the droplet would be. I cribbed most of its code from the
DKArcPath example you provided. I can load and save the object using
our XML file handling routines that programmatically create it, drag
on its center to move it around, and delete it, but when I go to draw
it, I click on the drawing and see it appear, then immediately
disappear as I lift up the mouse. There didn't seem to be a path
drawing routine that handled stamping an object onto the drawing, so I
repurposed lineCreateLoop:, but nothing leaps out at me as to what's
going wrong. I'll keep digging, but any suggestions as to what I
might be missing would be greatly appreciated.
______________________
Brad Larson
SonoPlot, Inc.
3030 Laura Lane, Suite 120
Middleton, WI 53562
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SPDrawablePoint.h
Type: application/octet-stream
Size: 431 bytes
Desc: not available
URL: <http://lists.apptree.net/pipermail/drawkit-apptree.net/attachments/20080626/142c232f/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SPDrawablePoint.m
Type: application/octet-stream
Size: 3757 bytes
Desc: not available
URL: <http://lists.apptree.net/pipermail/drawkit-apptree.net/attachments/20080626/142c232f/attachment-0001.obj>
-------------- next part --------------
More information about the Drawkit
mailing list