On Dec 12, 2013, at 10:52 AM, Graham Cox <graham....@bigpond.com> wrote:
>> Does it have to be the same exact pattern all the way around?  If it's okay 
>> to differ a teeny bit (I bet imperceptibly), you could solve the problem 
>> separately for the horizontal edges and the vertical edges, and draw four 
>> lines instead of one rect.
> 
> It doesn’t *have* to be the same as long as it doesn’t differ too much 
> visually, but detecting that a path is a simple rect (including rotated 
> cases) and breaking it into h and v lengths might turn out to be the hard 
> part. I also wonder if there’s a way to perform the calculation based on the 
> highest common factor (HCF) of the horizontal and vertical edges? That might 
> allow the dash to be tweaked as a single entity and applied in the usual way.

Interesting.  You could straighten out the angles of the rect and think of 
(say) the top and right edges as a single line:

o---+---+---+---+---o---+---+---o

Each of o's is a corner, and each of the +'s marks off a multiple of the HCF.  
So what you want is for the dash to be tweaked in such a way that all three o's 
are in the middle of some segment.

Sounds fun -- good luck!

--Andy


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to