MCPcopy Create free account
hub / github.com/SpartanJ/eepp / getSize

Method getSize

src/eepp/ui/uiicon.cpp:19–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17}
18
19Drawable* UIIcon::getSize( const int& size ) const {
20 auto it = mSizes.find( size );
21 if ( it != mSizes.end() )
22 return it->second;
23 int distance = UINT32_MAX;
24 Drawable* closest = nullptr;
25 for ( const auto& sit : mSizes ) {
26 int diff = abs( sit.first - size );
27 if ( diff < distance ) {
28 distance = diff;
29 closest = sit.second;
30 }
31 }
32 return closest;
33}
34
35void UIIcon::setSize( const int& size, Drawable* drawable ) {
36 mSizes[size] = drawable;

Callers

nothing calls this directly

Calls 9

eemaxFunction · 0.85
svgScaleMethod · 0.80
findMethod · 0.45
endMethod · 0.45
getGlyphDrawableMethod · 0.45
setSizeMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
loadFromMemoryMethod · 0.45

Tested by

no test coverage detected