comparison layer/Colour3DPlotLayer.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 0e971e3d93e2
children 563bab925c9b
comparison
equal deleted inserted replaced
1546:ec837d223bd9 1547:e6362cf5ff1d
1213 1213
1214 paintWithRenderer(v, paint, rect); 1214 paintWithRenderer(v, paint, rect);
1215 } 1215 }
1216 1216
1217 bool 1217 bool
1218 Colour3DPlotLayer::snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, 1218 Colour3DPlotLayer::snapToFeatureFrame(LayerGeometryProvider *v,
1219 sv_frame_t &frame,
1219 int &resolution, 1220 int &resolution,
1220 SnapType snap) const 1221 SnapType snap,
1222 int ycoord) const
1221 { 1223 {
1222 auto model = ModelById::getAs<DenseThreeDimensionalModel>(m_model); 1224 auto model = ModelById::getAs<DenseThreeDimensionalModel>(m_model);
1223 if (!model) { 1225 if (!model) {
1224 return Layer::snapToFeatureFrame(v, frame, resolution, snap); 1226 return Layer::snapToFeatureFrame(v, frame, resolution, snap, ycoord);
1225 } 1227 }
1226 1228
1227 resolution = model->getResolution(); 1229 resolution = model->getResolution();
1228 sv_frame_t left = (frame / resolution) * resolution; 1230 sv_frame_t left = (frame / resolution) * resolution;
1229 sv_frame_t right = left + resolution; 1231 sv_frame_t right = left + resolution;