MCPcopy Create free account
hub / github.com/cinder/Cinder / run

Method run

test/cairoTest/cairoTest.cpp:27–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25// Arc
26struct 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

Callers 1

mainFunction · 0.45

Calls 6

setLineWidthMethod · 0.80
strokeMethod · 0.80
setSourceRgbaMethod · 0.80
arcMethod · 0.45
fillMethod · 0.45
lineToMethod · 0.45

Tested by

no test coverage detected