Mercurial > hg > svgui
comparison layer/NoteLayer.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 e79731086b0f |
comparison
equal
deleted
inserted
replaced
1546:ec837d223bd9 | 1547:e6362cf5ff1d |
---|---|
545 } | 545 } |
546 | 546 |
547 bool | 547 bool |
548 NoteLayer::snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, | 548 NoteLayer::snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, |
549 int &resolution, | 549 int &resolution, |
550 SnapType snap) const | 550 SnapType snap, int ycoord) const |
551 { | 551 { |
552 auto model = ModelById::getAs<NoteModel>(m_model); | 552 auto model = ModelById::getAs<NoteModel>(m_model); |
553 if (!model) { | 553 if (!model) { |
554 return Layer::snapToFeatureFrame(v, frame, resolution, snap); | 554 return Layer::snapToFeatureFrame(v, frame, resolution, snap, ycoord); |
555 } | 555 } |
556 | 556 |
557 // SnapLeft / SnapRight: return frame of nearest feature in that | 557 // SnapLeft / SnapRight: return frame of nearest feature in that |
558 // direction no matter how far away | 558 // direction no matter how far away |
559 // | 559 // |