comparison layer/RegionLayer.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 e95cefd4aa81
comparison
equal deleted inserted replaced
1546:ec837d223bd9 1547:e6362cf5ff1d
464 } 464 }
465 465
466 bool 466 bool
467 RegionLayer::snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, 467 RegionLayer::snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame,
468 int &resolution, 468 int &resolution,
469 SnapType snap) const 469 SnapType snap, int ycoord) const
470 { 470 {
471 auto model = ModelById::getAs<RegionModel>(m_model); 471 auto model = ModelById::getAs<RegionModel>(m_model);
472 if (!model) { 472 if (!model) {
473 return Layer::snapToFeatureFrame(v, frame, resolution, snap); 473 return Layer::snapToFeatureFrame(v, frame, resolution, snap, ycoord);
474 } 474 }
475 475
476 // SnapLeft / SnapRight: return frame of nearest feature in that 476 // SnapLeft / SnapRight: return frame of nearest feature in that
477 // direction no matter how far away 477 // direction no matter how far away
478 // 478 //