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

Method set_size

dlib/gui_widgets/widgets.cpp:21–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19// ----------------------------------------------------------------------------------------
20
21 void toggle_button::
22 set_size (
23 unsigned long width,
24 unsigned long height
25 )
26 {
27 auto_mutex M(m);
28 rectangle min_rect = style->get_min_size(name_,*mfont);
29 // only change the size if it isn't going to be too small to fit the name
30 if (height >= min_rect.height() &&
31 width >= min_rect.width())
32 {
33 rectangle old(rect);
34 rect = resize_rect(rect,width,height);
35 parent.invalidate_rectangle(rect+old);
36 btn_tooltip.set_size(width,height);
37 }
38 }
39
40// ----------------------------------------------------------------------------------------
41

Callers

nothing calls this directly

Calls 15

resize_rectFunction · 0.85
get_min_sizeMethod · 0.80
set_rightMethod · 0.80
set_bottomMethod · 0.80
get_camera_posMethod · 0.80
get_camera_looking_atMethod · 0.80
camera_transformClass · 0.50
minFunction · 0.50
heightMethod · 0.45
widthMethod · 0.45

Tested by

no test coverage detected