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

Method getSeparatorsOffset

Tools/SkinEditor/SkinDataUtility.cpp:222–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220 }
221
222 MyGUI::IntRect SkinDataUtility::getSeparatorsOffset(DataPtr _skinData)
223 {
224 MyGUI::IntRect result;
225
226 for (Data::VectorData::const_iterator child = _skinData->getChilds().begin();
227 child != _skinData->getChilds().end();
228 child++)
229 {
230 if ((*child)->getType()->getName() != "Separator")
231 continue;
232
233 const std::string& name = (*child)->getPropertyValue("Name");
234 int offset = (*child)->getPropertyValue<int>("Offset");
235 bool visible = (*child)->getPropertyValue<bool>("Visible");
236 if (!visible)
237 offset = 0;
238
239 if (name == "Left")
240 result.left = offset;
241 else if (name == "Top")
242 result.top = offset;
243 else if (name == "Right")
244 result.right = offset;
245 else if (name == "Bottom")
246 result.bottom = offset;
247 }
248
249 return result;
250 }
251
252 void SkinDataUtility::fillRegionCoords(DataPtr _skinData, const SkinDataUtility::VectorCoord& _value)
253 {

Callers

nothing calls this directly

Calls 3

beginMethod · 0.45
endMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected