Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2014-04-24 18:37:26 +0400
committerJoshua Leung <aligorith@gmail.com>2014-04-24 19:14:02 +0400
commit8b24d0a2e9e20f77b5caf57531760a6baffac40c (patch)
tree34e7239c0a3e2ed1f47d12cf1c24ff9b252a70a3
parente80fbf8674c0913de6e5b747a8ff4d41c0d7cf46 (diff)
AutoSnap Bugfixes: NLA Editor - Nearest Frame/Second
Split off handling for nearest second from nearest frame
-rw-r--r--source/blender/editors/transform/transform_generics.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 4ee9f6bd6a6..98f6d50bc36 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -531,15 +531,14 @@ static void recalcData_nla(TransInfo *t)
/* handle auto-snapping */
switch (snla->autosnap) {
- case SACTSNAP_FRAME: /* snap to nearest frame/time */
- if (snla->flag & SNLA_DRAWTIME) {
- tdn->h1[0] = (float)(floor(((double)tdn->h1[0] / secf) + 0.5) * secf);
- tdn->h2[0] = (float)(floor(((double)tdn->h2[0] / secf) + 0.5) * secf);
- }
- else {
- tdn->h1[0] = floorf(tdn->h1[0] + 0.5f);
- tdn->h2[0] = floorf(tdn->h2[0] + 0.5f);
- }
+ case SACTSNAP_FRAME: /* snap to nearest frame */
+ tdn->h1[0] = floorf(tdn->h1[0] + 0.5f);
+ tdn->h2[0] = floorf(tdn->h2[0] + 0.5f);
+ break;
+
+ case SACTSNAP_SECOND: /* snap to nearest second */
+ tdn->h1[0] = (float)(floor(((double)tdn->h1[0] / secf) + 0.5) * secf);
+ tdn->h2[0] = (float)(floor(((double)tdn->h2[0] / secf) + 0.5) * secf);
break;
case SACTSNAP_MARKER: /* snap to nearest marker */