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

Function example_icon

test/test.cpp:1993–2045  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1991}
1992
1993void example_icon( canvas &that, float width, float height )
1994{
1995 that.set_shadow_color( 0.0f, 0.0f, 0.0f, 1.0f );
1996 that.shadow_offset_x = width / 64.0f;
1997 that.shadow_offset_y = height / 64.0f;
1998 that.set_shadow_blur( std::min( width, height ) / 32.0f );
1999 that.scale( width / 32.0f, height / 32.0f );
2000 that.set_color( fill_style, 0.4f, 0.05f, 0.2f, 1.0f );
2001 that.move_to( 15.5f, 1.0f );
2002 that.arc_to( 30.0f, 1.0f, 30.0f, 15.5f, 6.0f );
2003 that.arc_to( 30.0f, 30.0f, 15.5f, 30.0f, 6.0f );
2004 that.arc_to( 1.0f, 30.0f, 1.0f, 15.5f, 6.0f );
2005 that.arc_to( 1.0f, 1.0f, 15.5f, 1.0f, 6.0f );
2006 that.fill();
2007 that.set_color( stroke_style, 0.5f, 0.5f, 0.5f, 1.0f );
2008 that.begin_path();
2009 that.move_to( 11.0f, 16.0f );
2010 that.line_to( 27.0f, 16.0f );
2011 that.move_to( 2.0f, 23.0f );
2012 that.line_to( 29.0f, 23.0f );
2013 that.stroke();
2014 that.set_color( stroke_style, 0.75f, 0.75f, 0.75f, 1.0f );
2015 that.begin_path();
2016 that.arc( 25.0f, 22.0f, 0.5f, 0.0f, 6.28318531f );
2017 that.move_to( 19.0f, 6.0f );
2018 that.line_to( 18.5f, 8.0f );
2019 that.move_to( 20.0f, 6.0f );
2020 that.line_to( 20.0f, 8.0f );
2021 that.move_to( 21.0f, 6.0f );
2022 that.line_to( 21.5f, 8.0f );
2023 that.move_to( 17.0f, 14.0f );
2024 that.line_to( 16.0f, 18.0f );
2025 that.move_to( 20.0f, 14.0f );
2026 that.line_to( 20.0f, 18.0f );
2027 that.move_to( 23.0f, 14.0f );
2028 that.line_to( 24.0f, 18.0f );
2029 that.move_to( 18.0f, 9.0f );
2030 that.line_to( 22.0f, 9.0f );
2031 that.move_to( 18.0f, 13.0f );
2032 that.line_to( 22.0f, 13.0f );
2033 that.rectangle( 16.0f, 8.0f, 8.0f, 6.0f );
2034 that.stroke();
2035 that.set_color( stroke_style, 1.0f, 1.0f, 1.0f, 1.0f );
2036 that.begin_path();
2037 that.arc( 19.0f, 12.0f, 9.0f, 0.0f, 6.28318531f );
2038 that.move_to( 12.3f, 17.3f );
2039 that.line_to( 3.3f, 26.3f );
2040 that.move_to( 13.0f, 18.0f );
2041 that.line_to( 4.0f, 27.0f );
2042 that.move_to( 13.7f, 18.7f );
2043 that.line_to( 4.7f, 27.7f );
2044 that.stroke();
2045}
2046
2047void example_illusion( canvas &that, float width, float height )
2048{

Callers

nothing calls this directly

Calls 12

set_shadow_colorMethod · 0.80
set_shadow_blurMethod · 0.80
scaleMethod · 0.80
set_colorMethod · 0.80
move_toMethod · 0.80
arc_toMethod · 0.80
fillMethod · 0.80
begin_pathMethod · 0.80
line_toMethod · 0.80
strokeMethod · 0.80
arcMethod · 0.80
rectangleMethod · 0.80

Tested by

no test coverage detected