Mercurial > hg > svgui
comparison layer/TextLayer.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 | e95cefd4aa81 |
comparison
equal
deleted
inserted
replaced
1546:ec837d223bd9 | 1547:e6362cf5ff1d |
---|---|
236 //!!! too much overlap with TimeValueLayer/TimeInstantLayer | 236 //!!! too much overlap with TimeValueLayer/TimeInstantLayer |
237 | 237 |
238 bool | 238 bool |
239 TextLayer::snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, | 239 TextLayer::snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, |
240 int &resolution, | 240 int &resolution, |
241 SnapType snap) const | 241 SnapType snap, int ycoord) const |
242 { | 242 { |
243 auto model = ModelById::getAs<TextModel>(m_model); | 243 auto model = ModelById::getAs<TextModel>(m_model); |
244 if (!model) { | 244 if (!model) { |
245 return Layer::snapToFeatureFrame(v, frame, resolution, snap); | 245 return Layer::snapToFeatureFrame(v, frame, resolution, snap, ycoord); |
246 } | 246 } |
247 | 247 |
248 // SnapLeft / SnapRight: return frame of nearest feature in that | 248 // SnapLeft / SnapRight: return frame of nearest feature in that |
249 // direction no matter how far away | 249 // direction no matter how far away |
250 // | 250 // |