diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-05-04 18:20:40 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-05-04 18:20:40 +0300 |
commit | 1b8069bdd921a2807f156682aec540f2acc37e3c (patch) | |
tree | 3ca6a620b074065bcf95af9743ceb70ad37d3344 | |
parent | fd5090ab41f82b1e12e8e773b6088bf5a536acea (diff) |
UI: location/scale were snapping to 10s
In practice this isn't useful (for scale especially).
For float buttons with a very large range, don't attempt to match the snap to the range.
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 3d8a56c976c..7ed02c9e83e 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3501,6 +3501,16 @@ static float ui_numedit_apply_snapf(uiBut *but, float tempf, float softmin, floa softrange /= fac; } + /* workaround, too high snapping values */ + /* snapping by 10's for float buttons is quite annoying (location, scale...), + * but allow for rotations */ + if ((softrange > 2100.0f)) { + int unit_type = UI_but_unit_type_get(but); + if (!ELEM(unit_type, PROP_UNIT_ROTATION)) { + softrange = 20.0f; + } + } + if (snap == SNAP_ON) { if (softrange < 2.10f) tempf = roundf(tempf * 10.0f) * 0.1f; else if (softrange < 21.0f) tempf = roundf(tempf); |