MCPcopy Create free account
hub / github.com/TankOs/SFGUI / CalculateRequisition

Method CalculateRequisition

src/SFGUI/Entry.cpp:310–319  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308}
309
310sf::Vector2f Entry::CalculateRequisition() {
311 const std::string& font_name( Context::Get().GetEngine().GetProperty<std::string>( "FontName", shared_from_this() ) );
312 unsigned int font_size( Context::Get().GetEngine().GetProperty<unsigned int>( "FontSize", shared_from_this() ) );
313 float border_width( Context::Get().GetEngine().GetProperty<float>( "BorderWidth", shared_from_this() ) );
314 float text_padding( Context::Get().GetEngine().GetProperty<float>( "Padding", shared_from_this() ) );
315 const sf::Font& font( *Context::Get().GetEngine().GetResourceManager().GetFont( font_name ) );
316 auto line_height = Context::Get().GetEngine().GetFontLineHeight( font, font_size );
317
318 return sf::Vector2f( 2 * (border_width + text_padding), line_height + 2 * ( border_width + text_padding ) );
319}
320
321bool Entry::IsCursorVisible() const {
322 return m_cursor_status;

Callers

nothing calls this directly

Calls 1

GetFontLineHeightMethod · 0.80

Tested by

no test coverage detected