We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Making a rounded rect with arc
Page Index Toggle Pages: 1
Making a rounded rect with arc (Read 349 times)
Making a rounded rect with arc
Feb 5th, 2009, 5:09pm
 
I can't seem to make a rounded rectangle using five rectangles and four arcs without the seams showing through.  Please advise.  See the source and application at:

http://www.openprocessing.org/visuals/?visualID=980


Re: Making a rounded rect with arc
Reply #1 - Feb 5th, 2009, 6:26pm
 
I see no gap. I see the strokes, but I suppose they are intentional.
WinXP, Java 1.6.0_11
Re: Making a rounded rect with arc
Reply #2 - Feb 5th, 2009, 6:56pm
 
I actually mean that I want to get rid of the overlap of the sections.  I've purposely used a fill with an alpha value to reveal the seams, which I want to eliminate.

All the section drawing is in RoundedRect.updateTransDimensions().  

I suspect the problem is because I'm using floats to compute the width and position of the arcs and rectangles, and the method used to convert the floats to ints is handled differently by processing's rect() method than the arc() method.  

How can I gaurantee that the arc is adjacent but not overlapping it's neighboring rect?  

Shouldn't arc( 10, 10, 20, 20, PI, PI + HALF_PI ) line up flush with rect( 10, 0, 40, 10 )?
Page Index Toggle Pages: 1