Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/util/numinput.c
| Show First 20 Lines • Show All 97 Lines • ▼ Show 20 Lines | for (j = 0; j <= n->idx_max; j++) { | ||||
| /* if AFFECTALL and no number typed and cursor not on number, use first number */ | /* if AFFECTALL and no number typed and cursor not on number, use first number */ | ||||
| const short i = (n->flag & NUM_AFFECT_ALL && n->idx != j && !(n->val_flag[j] & NUM_EDITED)) ? 0 : j; | const short i = (n->flag & NUM_AFFECT_ALL && n->idx != j && !(n->val_flag[j] & NUM_EDITED)) ? 0 : j; | ||||
| /* Use scale_length if needed! */ | /* Use scale_length if needed! */ | ||||
| const float fac = (float)BKE_scene_unit_scale(unit_settings, n->unit_type[j], 1.0); | const float fac = (float)BKE_scene_unit_scale(unit_settings, n->unit_type[j], 1.0); | ||||
| if (n->val_flag[i] & NUM_EDITED) { | if (n->val_flag[i] & NUM_EDITED) { | ||||
| /* Get the best precision, allows us to draw '10.0001' as '10' instead! */ | /* Get the best precision, allows us to draw '10.0001' as '10' instead! */ | ||||
| prec = uiFloatPrecisionCalc(prec, (double)n->val[i]); | prec = UI_calc_float_precision(prec, (double)n->val[i]); | ||||
| if (i == n->idx) { | if (i == n->idx) { | ||||
| const char *heading_exp = "", *trailing_exp = ""; | const char *heading_exp = "", *trailing_exp = ""; | ||||
| char before_cursor[NUM_STR_REP_LEN]; | char before_cursor[NUM_STR_REP_LEN]; | ||||
| char val[16]; | char val[16]; | ||||
| if (n->val_flag[i] & NUM_NEGATE) { | if (n->val_flag[i] & NUM_NEGATE) { | ||||
| heading_exp = (n->val_flag[i] & NUM_INVERSE) ? "-1/(" : "-("; | heading_exp = (n->val_flag[i] & NUM_INVERSE) ? "-1/(" : "-("; | ||||
| trailing_exp = ")"; | trailing_exp = ")"; | ||||
| ▲ Show 20 Lines • Show All 406 Lines • Show Last 20 Lines | |||||