Re: bezier path redraw problems
Re: bezier path redraw problems
- Subject: Re: bezier path redraw problems
- From: Pete Carss <email@hidden>
- Date: Fri, 6 Dec 2002 12:40:31 +0000
You asked for it...I'm not sure how elegant the superview-superview
business is...
Pete
- (void)drawLineToMovie:(NSEvent *)theEvent
{
//Command Drag Happening, draw path to movie
NSPoint tmpCentre = NSZeroPoint;
NSPoint rectCentre = NSZeroPoint;
tmpCentre = [selectedItem centre];
//create bezier path with colour
NSBezierPath *lineToMovie = [NSBezierPath bezierPath];
[[NSColor blackColor] set];
NSPoint mouseLoc;
mouseLoc = [[[[self superview] superview] superview] convertPoint:
[theEvent locationInWindow] fromView:nil];
//create array of points - from selected rect to current mouse pos
- with extra point in middle for right angle
rectCentre = [[[[self superview] superview] superview]
convertPoint: tmpCentre fromView:self];
[lineToMovie moveToPoint: rectCentre];
[lineToMovie lineToPoint: NSMakePoint(rectCentre.x , mouseLoc.y)];
[lineToMovie lineToPoint: mouseLoc];
[lineToMovie setLineWidth: 20.0];
[lineToMovie stroke];
[[[[self superview] superview] superview] setNeedsDisplayInRect:
[lineToMovie bounds]];
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.