MCPcopy Create free account
hub / github.com/defold/defold / CalculateReferenceScale

Function CalculateReferenceScale

engine/gui/src/gui.cpp:1359–1373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1357 }
1358
1359 Vector4 CalculateReferenceScale(HScene scene, InternalNode* node)
1360 {
1361 float scale_x = 1.0f;
1362 float scale_y = 1.0f;
1363
1364 if (scene->m_AdjustReference == ADJUST_REFERENCE_LEGACY || node == 0x0 || node->m_ParentIndex == INVALID_INDEX) {
1365 scale_x = (float) scene->m_AdjustWidth / (float) scene->m_Width;
1366 scale_y = (float) scene->m_AdjustHeight / (float) scene->m_Height;
1367 } else {
1368 Vector4 adjust_scale = scene->m_Nodes[node->m_ParentIndex].m_Node.m_LocalAdjustScale;
1369 scale_x = adjust_scale.getX();
1370 scale_y = adjust_scale.getY();
1371 }
1372 return Vector4(scale_x, scale_y, 1.0f, 1.0f);
1373 }
1374
1375 inline void CalculateNodeSize(InternalNode* in)
1376 {

Callers 3

UpdateLocalTransformFunction · 0.70
ScreenToLocalPositionFunction · 0.70
TEST_FFunction · 0.50

Calls 3

Vector4Class · 0.50
getXMethod · 0.45
getYMethod · 0.45

Tested by 1

TEST_FFunction · 0.40