MCPcopy Create free account
hub / github.com/a-e-k/canvas_ity / rectangle

Function rectangle

test/test.cpp:1202–1221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1200}
1201
1202void rectangle( canvas &that, float width, float height )
1203{
1204 that.set_color( stroke_style, 0.0f, 0.0f, 0.0f, 1.0f );
1205 that.set_color( fill_style, 1.0f, 0.0f, 0.0f, 1.0f );
1206 that.set_line_width( 8.0f );
1207 that.move_to( 0.3f * width, 0.3f * height );
1208 that.line_to( 0.7f * width, 0.3f * height );
1209 that.line_to( 0.7f * width, 0.7f * height );
1210 that.line_to( 0.3f * width, 0.7f * height );
1211 that.close_path();
1212 that.move_to( 0.0f, 0.0f );
1213 for ( float y = -1.0f; y <= 1.0f; y += 1.0f )
1214 for ( float x = -1.0f; x <= 1.0f; x += 1.0f )
1215 that.rectangle( ( 0.5f + 0.1f * x ) * width,
1216 ( 0.5f + 0.1f * y ) * height,
1217 x * 0.3f * width, y * 0.3f * height );
1218 that.line_to( width, height );
1219 that.fill();
1220 that.stroke();
1221}
1222
1223void fill( canvas &that, float width, float height )
1224{

Callers

nothing calls this directly

Calls 8

set_colorMethod · 0.80
set_line_widthMethod · 0.80
move_toMethod · 0.80
line_toMethod · 0.80
close_pathMethod · 0.80
rectangleMethod · 0.80
fillMethod · 0.80
strokeMethod · 0.80

Tested by

no test coverage detected