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

Function ApplyAdjustOnReferenceScale

engine/gui/src/gui.cpp:2974–2992  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2972 }
2973
2974 static Vector4 ApplyAdjustOnReferenceScale(const Vector4& reference_scale, uint32_t adjust_mode)
2975 {
2976 Vector4 parent_adjust_scale = reference_scale;
2977 if (adjust_mode == dmGui::ADJUST_MODE_FIT)
2978 {
2979 float uniform = dmMath::Min(reference_scale.getX(), reference_scale.getY());
2980 parent_adjust_scale.setX(uniform);
2981 parent_adjust_scale.setY(uniform);
2982 }
2983 else if (adjust_mode == dmGui::ADJUST_MODE_ZOOM)
2984 {
2985 float uniform = dmMath::Max(reference_scale.getX(), reference_scale.getY());
2986 parent_adjust_scale.setX(uniform);
2987 parent_adjust_scale.setY(uniform);
2988 }
2989 parent_adjust_scale.setZ(1.0f);
2990 parent_adjust_scale.setW(1.0f);
2991 return parent_adjust_scale;
2992 }
2993
2994 static void AdjustPosScale(HScene scene, InternalNode* n, const Vector4& reference_scale, Vector4& position, Vector4& scale)
2995 {

Callers 2

AdjustPosScaleFunction · 0.85
ScreenToLocalPositionFunction · 0.85

Calls 8

MinFunction · 0.85
setZMethod · 0.80
setWMethod · 0.80
MaxFunction · 0.50
getXMethod · 0.45
getYMethod · 0.45
setXMethod · 0.45
setYMethod · 0.45

Tested by

no test coverage detected