Home » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » Painter 2.0
Re: Painter 2.0 [message #20443 is a reply to message #20278] |
Wed, 18 March 2009 23:34 |
Mindtraveller
Messages: 917 Registered: August 2007 Location: Russia, Moscow rgn.
|
Experienced Contributor |
|
|
As there`s no special "Painter" forum (hope we`ll have one), I post my little proposal here. It is adopted from one of my recent Painter etudes.
//Rectangle with rounded corners
Painter & Painter::Rectangle(double x, double y, double cx, double cy, double r)
{
ASSERT(r >= 0.);
if (cx < 0.) {x+=cx; cx=-cx;}
if (cy < 0.) {y+=cy; cy=-cy;}
Move(x+r,y)
.Arc(x+r,y+r,r,r,-M_PI/2.,-M_PI/2.)
.Line(x, y+cy-r)
.Arc(x+r,y+cy-r,r,r,M_PI,-M_PI/2.)
.Line(x+cx-r, y+cy)
.Arc(x+cx-r,y+cy-r,r,r,M_PI/2,-M_PI/2.)
.Line(x+cx, y+r)
.Arc(x+cx-r,y+r,r,r,0.,-M_PI/2.)
.Line(x+r, y);
}
[Updated on: Wed, 18 March 2009 23:38] Report message to a moderator
|
|
|
|
|
Painter 2.0
By: mirek on Thu, 12 February 2009 17:57
|
|
|
Re: Painter 2.0
By: Zardos on Thu, 12 February 2009 20:04
|
|
|
Re: Painter 2.0
|
|
|
Re: Painter 2.0
By: mirek on Fri, 13 February 2009 11:00
|
|
|
Re: Painter 2.0
|
|
|
Re: Painter 2.0
By: emr84 on Sat, 14 February 2009 00:31
|
|
|
Re: Painter 2.0
By: mirek on Sun, 15 February 2009 14:13
|
|
|
Re: Painter 2.0
By: emr84 on Mon, 16 February 2009 23:34
|
|
|
Re: Painter 2.0
By: kodos on Sun, 15 February 2009 15:24
|
|
|
Re: Painter 2.0
By: Tom1 on Tue, 17 February 2009 10:35
|
|
|
Re: Painter 2.0
By: mirek on Tue, 17 February 2009 12:06
|
|
|
Re: Painter 2.0
|
|
|
Re: Painter 2.0
By: mirek on Tue, 17 February 2009 14:42
|
|
|
Re: Painter 2.0
|
|
|
Re: Painter 2.0
By: mirek on Wed, 18 February 2009 14:47
|
|
|
Re: Painter 2.0
By: mirek on Wed, 18 February 2009 16:59
|
|
|
Re: Painter 2.0
|
|
|
Re: Painter 2.0
By: mirek on Fri, 06 March 2009 17:52
|
|
|
Re: Painter 2.0
|
|
|
Re: Painter 2.0
By: mirek on Thu, 19 March 2009 08:38
|
|
|
Re: Painter 2.0
|
|
|
Re: Painter 2.0
By: mirek on Fri, 20 March 2009 07:16
|
Goto Forum:
Current Time: Fri May 10 01:54:29 CEST 2024
Total time taken to generate the page: 0.02044 seconds
|