Mercurial > hg > svgui
comparison layer/ImageLayer.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 | 37df1530519d |
| children | 6616e1899daa |
comparison
equal
deleted
inserted
replaced
| 1546:ec837d223bd9 | 1547:e6362cf5ff1d |
|---|---|
| 220 //!!! too much overlap with TimeValueLayer/TimeInstantLayer/TextLayer | 220 //!!! too much overlap with TimeValueLayer/TimeInstantLayer/TextLayer |
| 221 | 221 |
| 222 bool | 222 bool |
| 223 ImageLayer::snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, | 223 ImageLayer::snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, |
| 224 int &resolution, | 224 int &resolution, |
| 225 SnapType snap) const | 225 SnapType snap, int ycoord) const |
| 226 { | 226 { |
| 227 auto model = ModelById::getAs<ImageModel>(m_model); | 227 auto model = ModelById::getAs<ImageModel>(m_model); |
| 228 if (!model) { | 228 if (!model) { |
| 229 return Layer::snapToFeatureFrame(v, frame, resolution, snap); | 229 return Layer::snapToFeatureFrame(v, frame, resolution, snap, ycoord); |
| 230 } | 230 } |
| 231 | 231 |
| 232 resolution = model->getResolution(); | 232 resolution = model->getResolution(); |
| 233 | 233 |
| 234 if (snap == SnapNeighbouring) { | 234 if (snap == SnapNeighbouring) { |
