From: Axel M. R. <rub...@me...> - 2007-07-10 09:45:00
|
At 11:26 +0200 10-07-2007, Axel M. Roest (i.e. me) wrote: >Hi, > >I want to use the function elementAtIndex_associatedPoints from >OSX::NSBezierPathElement, to get to the coordinates in a curve. The documentation is a little vague on this function, but the solution is as follows (thanks Laurent and Eloy): As you expect a point or array back, RubyCocoa thinks ahead of you and does not expect an empty array-pointer beforehand as you would in Obj-C. Instead you just get a new point or array back. You can use the function as follows: element, point = curve.elementAtIndex_associatedPoints(i) where i is the index of the curve element you're interested in. element is one of OSX::NSMoveToBezierPathElement, OSX::NSLineToBezierPathElement etc. point is an NSPoint, in the case of the above, or probably a ruby array of points in the case of an OSX::NSClosePathBezierPathElement, but I have not tested bezier curves yet. Axel -- _________________________ Axel Roest axelloroestello@{AIM/MSN} - Skype:axellofono - XOIP: 084-8749988 |