On 25/08/2009, at 8:44 AM, Alastair Houghton wrote:

On 24 Aug 2009, at 23:36, Ron Fleckner wrote:

I think you are right to suggest drawing it all in one view. That would probably avoid the problem. The reason I don't is I'm too much of a maths dolt to be able to work out the point co-ordinates for each of the hand positions.

:-)  You don't need to do that...

By giving each hand it's own view, I simply draw the hand from the centre to the top of the view, and then rotate the view by the required amount.

...and that's a *really* heavyweight way to do things. I'm surprised it's causing trouble (it shouldn't, I don't think), but you certainly don't need a view per hand anyway.

But now while writing this, I realize it's possible to rotate each hand by using CGContextAddArc(...) and have a different arc for each hand.

Rather than doing that, just draw them as you are doing now, but use NSAffineTransform (or CGAffineTransform) to set up the necessary transform yourself for each hand.

Kind regards,

Alastair.

Hmm... better and better. I'll certainly use affine transforms.

For the record, though, I must say that my current approach of having several stacked views and rotating each separately doesn't use much CPU at all. The whole point of this exercise, for me, was to have a resizable floating clock on my desktop. It can sit as a small but still easy to read thing up in the top right of my screen, or I can have it as big as the screen so I can see it from across the room. Only when the clock is large does it use 5~6% of CPU, otherwise it's about 1%.

Thanks, Alastair, for your suggestions and comments.

Ron
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Reply via email to