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

Function clear_rectangle

test/test.cpp:1537–1566  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1535}
1536
1537void clear_rectangle( canvas &that, float width, float height )
1538{
1539 that.set_color( stroke_style, 1.0f, 1.0f, 1.0f, 1.0f );
1540 that.set_color( fill_style, 0.4f, 0.05f, 0.2f, 1.0f );
1541 that.move_to( 0.0f, 0.0f );
1542 that.line_to( width, 0.0f );
1543 that.line_to( width, height );
1544 that.line_to( 0.0f, height );
1545 that.fill();
1546 that.rotate( 0.2f );
1547 that.begin_path();
1548 that.move_to( 0.2f * width, 0.2f * height );
1549 that.line_to( 0.8f * width, 0.2f * height );
1550 that.line_to( 0.8f * width, 0.8f * height );
1551 that.shadow_offset_x = 5.0f;
1552 that.set_shadow_color( 0.0f, 0.0f, 0.0f, 1.0f );
1553 that.global_composite_operation = destination_atop;
1554 that.set_global_alpha( 0.5f );
1555 for ( float y = -1.0f; y <= 1.0f; y += 1.0f )
1556 for ( float x = -1.0f; x <= 1.0f; x += 1.0f )
1557 that.clear_rectangle( ( 0.5f + 0.05f * x ) * width,
1558 ( 0.5f + 0.05f * y ) * height,
1559 x * 0.2f * width, y * 0.2f * height );
1560 that.set_global_alpha( 1.0f );
1561 that.global_composite_operation = source_over;
1562 that.set_shadow_color( 0.0f, 0.0f, 0.0f, 0.0f );
1563 that.line_to( 0.2f * width, 0.8f * height );
1564 that.close_path();
1565 that.stroke();
1566}
1567
1568void fill_rectangle( canvas &that, float width, float height )
1569{

Callers

nothing calls this directly

Calls 11

set_colorMethod · 0.80
move_toMethod · 0.80
line_toMethod · 0.80
fillMethod · 0.80
rotateMethod · 0.80
begin_pathMethod · 0.80
set_shadow_colorMethod · 0.80
set_global_alphaMethod · 0.80
clear_rectangleMethod · 0.80
close_pathMethod · 0.80
strokeMethod · 0.80

Tested by

no test coverage detected