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

Function SizeFromString

core/base/NS.cpp:169–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169Vec2 SizeFromString(std::string_view pszContent)
170{
171 Vec2 ret = Vec2::ZERO;
172
173 do
174 {
175 strArray strs;
176 AX_BREAK_IF(!splitWithForm(pszContent, strs));
177
178 float width = (float)utils::atof(strs[0].c_str());
179 float height = (float)utils::atof(strs[1].c_str());
180
181 ret = Vec2(width, height);
182 } while (0);
183
184 return ret;
185}
186
187}

Calls 4

splitWithFormFunction · 0.85
atofFunction · 0.85
Vec2Class · 0.70
c_strMethod · 0.45

Tested by

no test coverage detected