diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2017-12-05 13:48:37 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2017-12-05 13:48:37 +0300 |
commit | deaeee8e4d92cfd43e641db6a86273e70a4dae7d (patch) | |
tree | ec6566f1bec87a97008d9800b350449d290b1099 /source/blender/editors | |
parent | 7d50f1686975c699ccadfab0574dc25c3f0edf80 (diff) | |
parent | 1802d14394c52698c0501e03179a651cf3a65cfd (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/mesh/editmesh_bevel.c | 3 | ||||
-rw-r--r-- | source/blender/editors/util/numinput.c | 14 |
2 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/editors/mesh/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c index 68fd4212004..d4d7d92d5ad 100644 --- a/source/blender/editors/mesh/editmesh_bevel.c +++ b/source/blender/editors/mesh/editmesh_bevel.c @@ -58,8 +58,7 @@ #define MVAL_PIXEL_MARGIN 5.0f -/* until implement profile = 0 case, need to clamp somewhat above zero */ -#define PROFILE_HARD_MIN 0.15f +#define PROFILE_HARD_MIN 0.0f #define SEGMENTS_HARD_MAX 1000 diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c index 61142fdc887..0f3240946fd 100644 --- a/source/blender/editors/util/numinput.c +++ b/source/blender/editors/util/numinput.c @@ -488,8 +488,9 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event) const float fac = (float)BKE_scene_unit_scale(&sce->unit, n->unit_type[idx], 1.0); /* Make radian default unit when needed. */ - if (n->unit_use_radians && n->unit_type[idx] == B_UNIT_ROTATION) + if (n->unit_use_radians && n->unit_type[idx] == B_UNIT_ROTATION) { default_unit = "r"; + } BLI_strncpy(str_unit_convert, n->str, sizeof(str_unit_convert)); @@ -513,7 +514,16 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event) n->val[idx] = -n->val[idx]; } if (n->val_flag[idx] & NUM_INVERSE) { - n->val[idx] = 1.0f / n->val[idx]; + val = n->val[idx]; + /* If we invert on radians when user is in degrees, you get unexpected results... See T53463. */ + if (!n->unit_use_radians && n->unit_type[idx] == B_UNIT_ROTATION) { + val = RAD2DEG(val); + } + val = 1.0 / val; + if (!n->unit_use_radians && n->unit_type[idx] == B_UNIT_ROTATION) { + val = DEG2RAD(val); + } + n->val[idx] = (float)val; } if (UNLIKELY(!isfinite(n->val[idx]))) { |