MCPcopy Create free account
hub / github.com/MyGUI/mygui / updateResultPropery

Method updateResultPropery

Tools/FontEditor/FontTextureController.cpp:150–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148 }
149
150 void FontTextureController::updateResultPropery(DataPtr _data)
151 {
152 MyGUI::IResource* resource =
153 MyGUI::ResourceManager::getInstance().findByName(_data->getPropertyValue("FontName"));
154 MyGUI::ResourceTrueTypeFont* font =
155 resource != nullptr ? resource->castType<MyGUI::ResourceTrueTypeFont>(false) : nullptr;
156 MyGUI::ITexture* texture = font != nullptr ? font->getTextureFont() : nullptr;
157
158 if (texture != nullptr)
159 _data->setPropertyValue(
160 "TextureSizeResult",
161 MyGUI::utility::toString(texture->getWidth(), " ", texture->getHeight()));
162 else
163 _data->setPropertyValue("TextureSizeResult", "0 0");
164
165 if (font != nullptr)
166 _data->setPropertyValue("FontHeightPix", font->getDefaultHeight());
167 else
168 _data->setPropertyValue("FontHeightPix", "0");
169 }
170
171}

Callers

nothing calls this directly

Calls 7

toStringFunction · 0.85
findByNameMethod · 0.80
getTextureFontMethod · 0.45
setPropertyValueMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45
getDefaultHeightMethod · 0.45

Tested by

no test coverage detected