Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/unit.c
| Show First 20 Lines • Show All 809 Lines • ▼ Show 20 Lines | for (i = 0; i < len_max; i++) { | ||||
| if (ch_is_op(remaining_str[i])) { | if (ch_is_op(remaining_str[i])) { | ||||
| if (scientific_notation) { | if (scientific_notation) { | ||||
| scientific_notation = false; | scientific_notation = false; | ||||
| } | } | ||||
| /* Make sure we don't look backwards before the start of the string. */ | /* Make sure we don't look backwards before the start of the string. */ | ||||
| if (remaining_str != str && i != 0) { | if (remaining_str != str && i != 0) { | ||||
| /* Check for velocity or acceleration (e.g. '/' in 'ft/s' is not an op). */ | |||||
| if ((remaining_str[i] == '/') && ELEM(remaining_str[i - 1], 't', 'T', 'm', 'M') && | |||||
| ELEM(remaining_str[i + 1], 's', 'S')) { | |||||
| continue; | |||||
| } | |||||
| /* Check for scientific notation. */ | /* Check for scientific notation. */ | ||||
| if (remaining_str[i - 1] == 'e' || remaining_str[i - 1] == 'E') { | if (remaining_str[i - 1] == 'e' || remaining_str[i - 1] == 'E') { | ||||
| scientific_notation = true; | scientific_notation = true; | ||||
| continue; | continue; | ||||
| } | } | ||||
| /* Return position before a space character. */ | /* Return position before a space character. */ | ||||
| if (remaining_str[i - 1] == ' ') { | if (remaining_str[i - 1] == ' ') { | ||||
| ▲ Show 20 Lines • Show All 491 Lines • Show Last 20 Lines | |||||