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

Function shadow_offset

test/test.cpp:494–508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492}
493
494void shadow_offset( canvas &that, float width, float height )
495{
496 that.set_shadow_blur( 2.0f );
497 that.set_color( fill_style, 1.0f, 1.0f, 1.0f, 1.0f );
498 that.set_shadow_color( 0.0f, 0.0f, 0.0f, 1.0f );
499 for ( float y = 0.0f; y < 5.0f; y += 1.0f )
500 for ( float x = 0.0f; x < 5.0f; x += 1.0f )
501 {
502 that.shadow_offset_x = ( x - 2.0f ) * 4.0f;
503 that.shadow_offset_y = ( y - 2.0f ) * 4.0f;
504 that.fill_rectangle( ( x + 0.25f ) * 0.2f * width,
505 ( y + 0.25f ) * 0.2f * height,
506 0.1f * width, 0.1f * height );
507 }
508}
509
510void shadow_offset_offscreen( canvas &that, float width, float height )
511{

Callers

nothing calls this directly

Calls 4

set_shadow_blurMethod · 0.80
set_colorMethod · 0.80
set_shadow_colorMethod · 0.80
fill_rectangleMethod · 0.80

Tested by

no test coverage detected