MCPcopy Create free account
hub / github.com/davisking/dlib / draw_button_up

Function draw_button_up

dlib/gui_widgets/canvas_drawing.cpp:71–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69// ----------------------------------------------------------------------------------------
70
71 void draw_button_up (
72 const canvas& c,
73 const rectangle& btn,
74 unsigned char alpha
75 )
76 {
77 rectangle area = btn.intersect(c);
78 if (area.is_empty() == false)
79 {
80 const rgb_alpha_pixel dark_gray(64,64,64,alpha);
81 const rgb_alpha_pixel gray(128,128,128,alpha);
82 const rgb_alpha_pixel white(255,255,255,alpha);
83
84 draw_line(c,point(btn.left(),btn.top()),point(btn.right()-1,btn.top()),white);
85
86 draw_line(c,point(btn.left(),btn.bottom()),point(btn.right(),btn.bottom()),dark_gray);
87 draw_line(c,point(btn.left()+1,btn.bottom()-1),point(btn.right()-1,btn.bottom()-1),gray);
88
89 draw_line(c,point(btn.left(),btn.top()+1),point(btn.left(),btn.bottom()-1),white);
90
91 draw_line(c,point(btn.right(),btn.top()),point(btn.right(),btn.bottom()-1),dark_gray);
92 draw_line(c,point(btn.right()-1,btn.top()+1),point(btn.right()-1,btn.bottom()-2),gray);
93 }
94 }
95
96// ----------------------------------------------------------------------------------------
97

Callers 5

drawMethod · 0.85
draw_buttonMethod · 0.85
draw_buttonMethod · 0.85
draw_toggle_buttonMethod · 0.85

Calls 8

draw_lineFunction · 0.70
pointClass · 0.70
intersectMethod · 0.45
is_emptyMethod · 0.45
leftMethod · 0.45
topMethod · 0.45
rightMethod · 0.45
bottomMethod · 0.45

Tested by

no test coverage detected