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

Method get_text_rect

dlib/gui_widgets/widgets.cpp:422–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

420// ----------------------------------------------------------------------------------------
421
422 rectangle text_field::
423 get_text_rect (
424 ) const
425 {
426 // figure out where the text string should appear
427 unsigned long vertical_pad = (rect.height() - mfont->height())/2+1;
428
429 rectangle text_rect;
430 text_rect.set_left(rect.left()+style->get_padding(*mfont));
431 text_rect.set_top(rect.top()+vertical_pad);
432 text_rect.set_right(rect.right()-style->get_padding(*mfont));
433 text_rect.set_bottom(text_rect.top()+mfont->height()-1);
434 return text_rect;
435 }
436
437// ----------------------------------------------------------------------------------------
438

Callers

nothing calls this directly

Calls 10

set_leftMethod · 0.80
set_topMethod · 0.80
set_rightMethod · 0.80
set_bottomMethod · 0.80
heightMethod · 0.45
leftMethod · 0.45
get_paddingMethod · 0.45
topMethod · 0.45
rightMethod · 0.45
bottomMethod · 0.45

Tested by

no test coverage detected