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

Method need_h_scroll

dlib/gui_widgets/base_widgets.cpp:3080–3098  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3078// ----------------------------------------------------------------------------------------
3079
3080 bool scrollable_region::
3081 need_h_scroll (
3082 ) const
3083 {
3084 if (total_rect_.width() > rect.width()-style->get_border_size()*2)
3085 {
3086 return true;
3087 }
3088 else
3089 {
3090 // check if we would need a vertical scroll bar and if adding one would make us need
3091 // a horizontal one
3092 if (total_rect_.height() > rect.height()-style->get_border_size()*2 &&
3093 total_rect_.width() > rect.width()-style->get_border_size()*2-vsb.width())
3094 return true;
3095 else
3096 return false;
3097 }
3098 }
3099
3100// ----------------------------------------------------------------------------------------
3101

Callers

nothing calls this directly

Calls 3

widthMethod · 0.45
get_border_sizeMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected