From 1b8069bdd921a2807f156682aec540f2acc37e3c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 5 May 2015 01:20:40 +1000 Subject: 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. --- source/blender/editors/interface/interface_handlers.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/blender/editors/interface/interface_handlers.c') 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); -- cgit v1.2.3