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

Method getWorldCenterPoint

core/ui/UILayout.cpp:1063–1070  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1061}
1062
1063Vec2 Layout::getWorldCenterPoint(Widget* widget) const
1064{
1065 Layout* layout = dynamic_cast<Layout*>(widget);
1066 // FIXEDME: we don't need to calculate the content size of layout anymore
1067 Vec2 widgetSize = layout ? layout->getLayoutAccumulatedSize() : widget->getContentSize();
1068 // AXLOGD("content size : width = {}, height = {}", widgetSize.width, widgetSize.height);
1069 return widget->convertToWorldSpace(Vec2(widgetSize.width / 2, widgetSize.height / 2));
1070}
1071
1072float Layout::calculateNearestDistance(Widget* baseWidget)
1073{

Calls 4

convertToWorldSpaceMethod · 0.80
Vec2Function · 0.50
getContentSizeMethod · 0.45

Tested by

no test coverage detected