comparison layer/TimeRulerLayer.cpp @ 1431:af824022bffd single-point

Begin fixing the various snap operations. Also remove SnapNearest, which is never used and seems to consume more lines of code than the rest!
author Chris Cannam
date Wed, 20 Mar 2019 14:59:34 +0000
parents c8a6fd3f9dff
children f2525e6cbdf1
comparison
equal deleted inserted replaced
1430:31499c3520ee 1431:af824022bffd
85 break; 85 break;
86 86
87 case SnapRight: 87 case SnapRight:
88 frame = right; 88 frame = right;
89 break; 89 break;
90
91 case SnapNearest:
92 {
93 if (llabs(frame - left) > llabs(right - frame)) {
94 frame = right;
95 } else {
96 frame = left;
97 }
98 break;
99 }
100 90
101 case SnapNeighbouring: 91 case SnapNeighbouring:
102 { 92 {
103 int dl = -1, dr = -1; 93 int dl = -1, dr = -1;
104 int x = v->getXForFrame(frame); 94 int x = v->getXForFrame(frame);