Adding hit test to circleview question.
Adding hit test to circleview question.
- Subject: Adding hit test to circleview question.
- From: Scott Andrew <email@hidden>
- Date: Tue, 13 Sep 2005 15:20:48 -0700
So i want to add hit testing to the circle view example. I am not at
math so i have the following in drawRect inside the for loop to draw
each character:
NSRectArray rects = [layoutManager
rectArrayForCharacterRange:NSMakeRange(glyphIndex, 1)
withinSelectedCharacterRange:NSMakeRange
(NSNotFound, 0) inTextContainer:textContainer rectCount:&rectCount];
// calucalte angles and such using some modified code i found on the
list.
[transform translateXBy:viewLocation.x yBy:viewLocation.y];
[transform rotateByRadians:-angle2];
rDraw.origin.x = 0;
rDraw.origin.y = 0;
rDraw.size = rects[0].size;
NSBezierPath* path = [NSBezierPath bezierPathWithRect:rDraw];
// get transform the BezierPath..
[path transformUsingAffineTransform:transform];
Queston for hit testing. Can i just store an array of paths and use
containsPoints:? The a rect does me no good becuase we are talking
about hit testing a skewed rectangle. Or do i want to get the 4
points that make up the skewed rect and write my own hit testing? Am
I missing something that I might be getting for free? Are there any
good examples of drawing a custom caret anywhere?
Scott Andrew
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden