MCPcopy Create free account
hub / github.com/axmolengine/axmol / getNormalSize

Method getNormalSize

core/ui/UIButton.cpp:922–938  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

920 }
921}
922Vec2 Button::getNormalSize() const
923{
924 Vec2 titleSize;
925 if (_titleRenderer != nullptr)
926 {
927 titleSize = _titleRenderer->getContentSize();
928 }
929 Vec2 imageSize;
930 if (_buttonNormalRenderer != nullptr)
931 {
932 imageSize = _buttonNormalRenderer->getContentSize();
933 }
934 float width = titleSize.width > imageSize.width ? titleSize.width : imageSize.width;
935 float height = titleSize.height > imageSize.height ? titleSize.height : imageSize.height;
936
937 return Vec2(width, height);
938}
939
940Vec2 Button::getNormalTextureSize() const
941{

Callers 2

setupNormalTextureMethod · 0.95

Calls 2

Vec2Function · 0.50
getContentSizeMethod · 0.45

Tested by

no test coverage detected