comparison layer/Layer.h @ 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 05d614f6e46d
children 98157ea8a3d2
comparison
equal deleted inserted replaced
1430:31499c3520ee 1431:af824022bffd
159 } 159 }
160 160
161 enum SnapType { 161 enum SnapType {
162 SnapLeft, 162 SnapLeft,
163 SnapRight, 163 SnapRight,
164 SnapNearest,
165 SnapNeighbouring 164 SnapNeighbouring
166 }; 165 };
167 166
168 /** 167 /**
169 * Adjust the given frame to snap to the nearest feature, if 168 * Adjust the given frame to snap to the nearest feature, if
170 * possible. 169 * possible.
171 * 170 *
172 * If snap is SnapLeft or SnapRight, adjust the frame to match 171 * If snap is SnapLeft or SnapRight, adjust the frame to match
173 * that of the nearest feature in the given direction regardless 172 * that of the nearest feature in the given direction regardless
174 * of how far away it is. If snap is SnapNearest, adjust the 173 * of how far away it is. If snap is SnapNeighbouring, adjust the
175 * frame to that of the nearest feature in either direction. If 174 * frame to that of the nearest feature in either direction if it
176 * snap is SnapNeighbouring, adjust the frame to that of the 175 * is close, and leave it alone (returning false) otherwise.
177 * nearest feature if it is close, and leave it alone (returning 176 * SnapNeighbouring should always choose the same feature that
178 * false) otherwise. SnapNeighbouring should always choose the 177 * would be used in an editing operation through calls to
179 * same feature that would be used in an editing operation through 178 * editStart etc.
180 * calls to editStart etc.
181 * 179 *
182 * Return true if a suitable feature was found and frame adjusted 180 * Return true if a suitable feature was found and frame adjusted
183 * accordingly. Return false if no suitable feature was available 181 * accordingly. Return false if no suitable feature was available
184 * (and leave frame unmodified). If returning true, also return 182 * (and leave frame unmodified). If returning true, also return
185 * the resolution of the model in this layer in sample frames. 183 * the resolution of the model in this layer in sample frames.