Cleanup: Rename public "bUnit" functions
This commit renames the functions in "BKE_unit.h` to be consistent with the naming in the rest of blenkernel. bUnit_AsString -> BKE_unit_value_as_string_adaptive bUnit_AsString2 -> BKE_unit_value_as_string bUnit_ReplaceString -> BKE_unit_replace_string bUnit_ApplyPreferredUnit -> BKE_unit_apply_preferred_unit bUnit_ToUnitAltName -> BKE_unit_name_to_alt bUnit_ClosestScalar -> BKE_unit_closest_scalar bUnit_BaseScalar -> BKE_unit_base_scalar bUnit_IsValid -> BKE_unit_is_valid bUnit_GetSystem -> BKE_unit_system_get bUnit_GetBaseUnit -> BKE_unit_base_get bUnit_GetBaseUnitOfType -> BKE_unit_base_of_type_get bUnit_GetName -> BKE_unit_name_get bUnit_GetNameDisplay -> BKE_unit_display_name_get bUnit_GetIdentifier -> BKE_unit_identifier_get bUnit_GetScaler -> BKE_unit_scalar_get bUnit_IsSuppressed -> BKE_unit_is_suppressed Differential Revision: https://developer.blender.org/D8828
This commit is contained in:
@@ -4614,8 +4614,8 @@ static float ui_numedit_apply_snapf(
|
||||
UnitSettings *unit = but->block->unit;
|
||||
const int unit_type = RNA_SUBTYPE_UNIT_VALUE(UI_but_unit_type_get(but));
|
||||
|
||||
if (bUnit_IsValid(unit->system, unit_type)) {
|
||||
fac = (float)bUnit_BaseScalar(unit->system, unit_type);
|
||||
if (BKE_unit_is_valid(unit->system, unit_type)) {
|
||||
fac = (float)BKE_unit_base_scalar(unit->system, unit_type);
|
||||
if (ELEM(unit_type, B_UNIT_LENGTH, B_UNIT_AREA, B_UNIT_VOLUME)) {
|
||||
fac /= unit->scale_length;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user