Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bezier path redraw problems



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.
References: 
 >Re: bezier path redraw problems (From: j o a r <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.