Professor Posted April 14, 2014 Share Posted April 14, 2014 While working with Graphics.draw.Ellipse(), I believe I discovered an error in the documentation. The four parameters (x, y, width, height) are stated to be the x/y coordinates of the upper-left corner of the framing rectangle of the ellipse, along with the width and height of the ellipse. As currently implemented, x and y are actually the coordinates of the CENTER of the ellipse, width is the horizontal RADIUS (one/half the total width), and height is the vertical RADIUS (one-half the total height). The function works fine otherwise. - prof Quote Link to comment Share on other sites More sharing options...
Leth Posted April 15, 2014 Share Posted April 15, 2014 The documentation is fine. It's the upper-left corner of the framing rectangle of the ellipse, not the upper-left corner of the ellipse itself. But the x and y are indeed the center of the ellipse. A graphic inherits from DisplayObjectContainer, you have to move the graphic to a new position if you want to see all the ellipse on the stage: http://jsfiddle.net/yX3T5/ Set the positions to 0, 0 on the jsfiddle and you'll see that the x and y are the upper-left corner of the framing rectangle AND the center of the ellipse Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.