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

Method set_size

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

Source from the content-addressed store, hash-verified

19// ----------------------------------------------------------------------------------------
20
21 void 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(style->get_invalidation_rect(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
pointClass · 0.70
rectangleClass · 0.50
heightMethod · 0.45
widthMethod · 0.45
get_invalidation_rectMethod · 0.45
set_sizeMethod · 0.45
get_border_sizeMethod · 0.45
set_posMethod · 0.45
rightMethod · 0.45
topMethod · 0.45

Tested by

no test coverage detected