• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Adding hit test to circleview question.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Adding hit test to circleview question.


  • Subject: Adding hit test to circleview question.
  • From: Scott Andrew <email@hidden>
  • Date: Tue, 13 Sep 2005 13:50:21 -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


  • Prev by Date: Re: Bug in NSImageView / NSPDFImageRep in Tiger?
  • Next by Date: Re: Compute value in IB using bindings
  • Previous by thread: Re: Disabling Display of JPG and PDF Files in NSTextView
  • Next by thread: Adding hit test to circleview question.
  • Index(es):
    • Date
    • Thread