| 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 | { |