comparison layer/TimeInstantLayer.cpp @ 1547:e6362cf5ff1d

Pass a y-coord, optionally, to Layer::snapToFeatureFrame. This is necessary for BoxLayer which needs to coordinate its snaps with the box it is highlighting for editing. Then in BoxLayer, merge getPointToDrag and getLocalPoints into a single getLocalPoint and use this throughout.
author Chris Cannam
date Thu, 17 Oct 2019 11:12:54 +0100
parents 4f8c72adbf43
children 9a5eede01869
comparison
equal deleted inserted replaced
1546:ec837d223bd9 1547:e6362cf5ff1d
275 } 275 }
276 276
277 bool 277 bool
278 TimeInstantLayer::snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, 278 TimeInstantLayer::snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame,
279 int &resolution, 279 int &resolution,
280 SnapType snap) const 280 SnapType snap, int ycoord) const
281 { 281 {
282 auto model = ModelById::getAs<SparseOneDimensionalModel>(m_model); 282 auto model = ModelById::getAs<SparseOneDimensionalModel>(m_model);
283 if (!model) { 283 if (!model) {
284 return Layer::snapToFeatureFrame(v, frame, resolution, snap); 284 return Layer::snapToFeatureFrame(v, frame, resolution, snap, ycoord);
285 } 285 }
286 286
287 // SnapLeft / SnapRight: return frame of nearest feature in that 287 // SnapLeft / SnapRight: return frame of nearest feature in that
288 // direction no matter how far away 288 // direction no matter how far away
289 // 289 //