Mercurial > hg > svgui
comparison layer/TimeValueLayer.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 | 9ce6f69cd485 |
children | e95cefd4aa81 |
comparison
equal
deleted
inserted
replaced
1546:ec837d223bd9 | 1547:e6362cf5ff1d |
---|---|
685 | 685 |
686 bool | 686 bool |
687 TimeValueLayer::snapToFeatureFrame(LayerGeometryProvider *v, | 687 TimeValueLayer::snapToFeatureFrame(LayerGeometryProvider *v, |
688 sv_frame_t &frame, | 688 sv_frame_t &frame, |
689 int &resolution, | 689 int &resolution, |
690 SnapType snap) const | 690 SnapType snap, int ycoord) const |
691 { | 691 { |
692 auto model = ModelById::getAs<SparseTimeValueModel>(m_model); | 692 auto model = ModelById::getAs<SparseTimeValueModel>(m_model); |
693 if (!model) { | 693 if (!model) { |
694 return Layer::snapToFeatureFrame(v, frame, resolution, snap); | 694 return Layer::snapToFeatureFrame(v, frame, resolution, snap, ycoord); |
695 } | 695 } |
696 | 696 |
697 // SnapLeft / SnapRight: return frame of nearest feature in that | 697 // SnapLeft / SnapRight: return frame of nearest feature in that |
698 // direction no matter how far away | 698 // direction no matter how far away |
699 // | 699 // |