#1440 drawRect with rounded corners

mooney_j Sun 6 Mar 2011

In Java you have:

RoundRectangle2D r = new RoundRectangle2D.Float(110, 110, 245, 160, 10, 10);

Anything similar in Fantom - or should I roll my own?

brian Mon 7 Mar 2011

I added some methods to Graphics for you:

**
** Draw a rectangle with rounded corners with the current pen and brush.
** The ellipse of the corners is specified by wArc and hArc.
**
abstract This drawRoundRect(Int x, Int y, Int w, Int h, Int wArc, Int hArc)

**
** Fill a rectangle with rounded corners with the current brush.
** The ellipse of the corners is specified by wArc and hArc.
**
abstract This fillRoundRect(Int x, Int y, Int w, Int h, Int wArc, Int hArc)

Should work in both SWT in JS - changeset

mooney_j Tue 8 Mar 2011

Thanks! I will check it out later. I have implemented my own version in the meantime.

Login or Signup to reply.