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

Function draw_button_down

dlib/gui_widgets/canvas_drawing.cpp:44–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42// ----------------------------------------------------------------------------------------
43
44 void draw_button_down (
45 const canvas& c,
46 const rectangle& btn,
47 unsigned char alpha
48 )
49 {
50 rectangle area = btn.intersect(c);
51 if (area.is_empty() == false)
52 {
53 const rgb_alpha_pixel dark_gray(64,64,64,alpha);
54 const rgb_alpha_pixel gray(128,128,128,alpha);
55 const rgb_alpha_pixel black(0,0,0,alpha);
56
57 draw_line(c,point(btn.left(),btn.top()),point(btn.right(),btn.top()),black);
58
59 draw_line(c,point(btn.left()+1,btn.bottom()),point(btn.right(),btn.bottom()),dark_gray);
60 draw_line(c,point(btn.left()+1,btn.top()+1),point(btn.right()-1,btn.top()+1),gray);
61
62 draw_line(c,point(btn.left(),btn.top()+1),point(btn.left(),btn.bottom()),black);
63
64 draw_line(c,point(btn.right(),btn.top()+1),point(btn.right(),btn.bottom()-1),dark_gray);
65 draw_line(c,point(btn.left()+1,btn.top()+1),point(btn.left()+1,btn.bottom()-1),gray);
66 }
67 }
68
69// ----------------------------------------------------------------------------------------
70

Callers 3

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