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

Function line_width

test/test.cpp:579–602  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

577}
578
579void line_width( canvas &that, float width, float height )
580{
581 that.set_color( stroke_style, 0.0f, 0.0f, 0.0f, 1.0f );
582 that.set_line_width( 4.0f );
583 for ( float step = 0.0f; step < 16.0f; step += 1.0f )
584 {
585 float left = ( step + 0.25f ) / 16.0f * width;
586 float right = ( step + 0.75f ) / 16.0f * width;
587 that.begin_path();
588 that.move_to( left, 0.0f );
589 that.bezier_curve_to( left, 0.5f * height,
590 right, 0.5f * height,
591 right, height );
592 that.set_line_width( 0.5f * ( step - 1 ) );
593 that.stroke();
594 }
595 that.set_color( fill_style, 1.0f, 1.0f, 1.0f, 1.0f );
596 that.global_composite_operation = source_atop;
597 that.fill_rectangle( 0.0f, 0.5f * height, width, 0.5f * height );
598 that.global_composite_operation = destination_over;
599 that.fill_rectangle( 0.0f, 0.25f * height, width, 0.25f * height );
600 that.set_color( fill_style, 0.0f, 0.0f, 0.0f, 1.0f );
601 that.fill_rectangle( 0.0f, 0.5f * height, width, 0.25f * height );
602}
603
604void line_width_angular( canvas &that, float width, float height )
605{

Callers

nothing calls this directly

Calls 7

set_colorMethod · 0.80
set_line_widthMethod · 0.80
begin_pathMethod · 0.80
move_toMethod · 0.80
bezier_curve_toMethod · 0.80
strokeMethod · 0.80
fill_rectangleMethod · 0.80

Tested by

no test coverage detected