> Hi Chris, > > Thanks very much for your reply. > > "You can pass int parameters to either of the Float > or Double constructors ..." > > You're right, although I thought you'd have to cast > the values first? >
Why not take a few seconds and try it yourself? > "As for your second question ..." > > Without anti-aliasing, I see no difference between a > rectangle at 0 and one at 0.99 (the x coordinate) > (this is true with anti-aliasing turned on as well, > but I assume it's because there are no curved areas). > I do, however, notice a change with an ellipse, as > you mentioned. There's a difference in rendering > between an ellipse positioned at 0 and one at 0.49. > Is it because the non-integer coordinates affect the > result of calculating the position of the pixels > within the arcs of the ellipse? If this is true, then > surely regular rectangles and lines would not be > affected by non-integer coordinates, unless perhaps > they were transformed? In other words, shapes are > rendered at integer locations, but the rounding can > be affected by the calculation of curves and > transformations? But then why would you choose to > render a shape at a non-integer location in the first > place? I hope I'm not making a fool of myself here. > > It also brings another question to my mind -- When > should you use the float constructors, and when > should you use the double constructors? I assume > double is more precise, but uses more memory? Would > it be used where accuracy is important, such as in > CAD applications? > Depends on the application; double is really important in the mapping/GIS industry, for example. > "The drawRect(), fillRect(), etc methods on the > Graphics class are still your best bet ..." > > OK, but this assumes you wish to position a shape in > an integer location only? > Yep. > *sigh* Maybe I should just forget about understanding > this stuff. > It sounds like you have a pretty good grasp already, so I wouldn't fret too much if I were you. > "On Tiger, you pretty much have no choice but to use > the two-pass technique you describe ..." > > Actually, my technique is (clip, fillR, fillR, reset > clip, drawRR) (5 steps, as apposed to 6). > Sorry, that's what I meant. > "The behavior you're seeing where the corners are > clipped off is caused by slight differences between > the clip region and the way the rounded rect shape is > stroked ..." > > Yeah, I think some of the anti-aliasing of the stroke > is being rendered outside of the clip. > Right. > "1. Don't use drawRoundRect() to draw one-pixel tall > horizontal lines." > > Hmmm ... I never did that? Or are you joking? > Sorry, that was an old joke. We have seen some rather creative approaches to rendering simple primitives over the years :) Chris [Message sent by forum member 'campbell' (campbell)] http://forums.java.net/jive/thread.jspa?messageID=115940 =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".