Mercurial > hg > svgui
comparison layer/Layer.h @ 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 | a0b2f3b4dd2f |
comparison
equal
deleted
inserted
replaced
1546:ec837d223bd9 | 1547:e6362cf5ff1d |
---|---|
183 * is close, and leave it alone (returning false) otherwise. | 183 * is close, and leave it alone (returning false) otherwise. |
184 * SnapNeighbouring should always choose the same feature that | 184 * SnapNeighbouring should always choose the same feature that |
185 * would be used in an editing operation through calls to | 185 * would be used in an editing operation through calls to |
186 * editStart etc. | 186 * editStart etc. |
187 * | 187 * |
188 * If ycoord is non-negative, it contains the y coordinate at | |
189 * which the interaction that prompts this snap is taking place | |
190 * (e.g. of the mouse press used for a selection action). Layers | |
191 * that have objects at multiple different heights may choose to | |
192 * use this information. If the current action has no particular y | |
193 * coordinate associated with it, ycoord will be passed as -1. | |
194 * | |
188 * Return true if a suitable feature was found and frame adjusted | 195 * Return true if a suitable feature was found and frame adjusted |
189 * accordingly. Return false if no suitable feature was available | 196 * accordingly. Return false if no suitable feature was available |
190 * (and leave frame unmodified). If returning true, also return | 197 * (and leave frame unmodified). If returning true, also return |
191 * the resolution of the model in this layer in sample frames. | 198 * the resolution of the model in this layer in sample frames. |
192 */ | 199 */ |
193 virtual bool snapToFeatureFrame(LayerGeometryProvider * /* v */, | 200 virtual bool snapToFeatureFrame(LayerGeometryProvider * /* v */, |
194 sv_frame_t & /* frame */, | 201 sv_frame_t & /* frame */, |
195 int &resolution, | 202 int &resolution, |
196 SnapType /* snap */) const { | 203 SnapType /* snap */, |
204 int /* ycoord */) const { | |
197 resolution = 1; | 205 resolution = 1; |
198 return false; | 206 return false; |
199 } | 207 } |
200 | 208 |
201 /** | 209 /** |