| 25 | // Arc |
| 26 | struct TestArc : public TestBase { |
| 27 | virtual void run( fli::cairo::Context &ctx ) { |
| 28 | double xc = 128.0; |
| 29 | double yc = 128.0; |
| 30 | double radius = 100.0; |
| 31 | double angle1 = 45.0 * ( M_PI / 180.0 ); /* angles are specified */ |
| 32 | double angle2 = 180.0 * ( M_PI / 180.0 ); /* in radians */ |
| 33 | |
| 34 | ctx.setLineWidth( 10.0 ); |
| 35 | ctx.arc( xc, yc, radius, angle1, angle2 ); |
| 36 | ctx.stroke(); |
| 37 | |
| 38 | /* draw helping lines */ |
| 39 | ctx.setSourceRgba( 1, 0.2, 0.2, 0.6 ); |
| 40 | ctx.setLineWidth( 6.0 ); |
| 41 | |
| 42 | ctx.arc( xc, yc, 10.0, 0, 2*M_PI ); |
| 43 | ctx.fill(); |
| 44 | |
| 45 | ctx.arc( xc, yc, radius, angle1, angle1 ); |
| 46 | ctx.lineTo( xc, yc); |
| 47 | ctx.arc( xc, yc, radius, angle2, angle2 ); |
| 48 | ctx.lineTo( xc, yc ); |
| 49 | ctx.stroke(); |
| 50 | } |
| 51 | }; |
| 52 | |
| 53 | // Arc Negative |
no test coverage detected