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

Method updateDrawNodeSize

tests/cpp-tests/Source/LabelTest/LabelTest.cpp:2892–2908  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2890}
2891
2892void LabelLayoutBaseTest::updateDrawNodeSize(const ax::Size& drawNodeSize)
2893{
2894 auto origin = Director::getInstance()->getWinSize();
2895 auto labelSize = _label->getContentSize();
2896
2897 origin.width = origin.width / 2 - (labelSize.width / 2);
2898 origin.height = origin.height / 2 - (labelSize.height / 2);
2899
2900 Vec2 vertices[4] = {Vec2(origin.width, origin.height), Vec2(drawNodeSize.width + origin.width, origin.height),
2901 Vec2(drawNodeSize.width + origin.width, drawNodeSize.height + origin.height),
2902 Vec2(origin.width, drawNodeSize.height + origin.height)};
2903 _drawNode->clear();
2904 _drawNode->drawLine(vertices[0], vertices[1], Color4F(1.0f, 1.0f, 1.0f, 1.0f));
2905 _drawNode->drawLine(vertices[0], vertices[3], Color4F(1.0f, 1.0f, 1.0f, 1.0f));
2906 _drawNode->drawLine(vertices[2], vertices[3], Color4F(1.0f, 1.0f, 1.0f, 1.0f));
2907 _drawNode->drawLine(vertices[1], vertices[2], Color4F(1.0f, 1.0f, 1.0f, 1.0f));
2908}
2909
2910LabelWrapByWordTest::LabelWrapByWordTest()
2911{

Callers 9

initWrapOptionMethod · 0.95
initSlidersMethod · 0.95
initDrawNodeMethod · 0.95
valueChangedMethod · 0.95
LabelResizeTestMethod · 0.80
LabelToggleTypeTestMethod · 0.80
LabelSystemFontTestMethod · 0.80
LabelCharMapFontTestMethod · 0.80

Calls 6

getInstanceFunction · 0.85
Vec2Function · 0.50
Color4FFunction · 0.50
getContentSizeMethod · 0.45
clearMethod · 0.45
drawLineMethod · 0.45

Tested by

no test coverage detected