Mercurial > hg > svgui
comparison view/Pane.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 | 35c7b7a592f0 |
children | 0f36e0eca6b0 |
comparison
equal
deleted
inserted
replaced
1546:ec837d223bd9 | 1547:e6362cf5ff1d |
---|---|
1438 | 1438 |
1439 Layer *layer = getInteractionLayer(); | 1439 Layer *layer = getInteractionLayer(); |
1440 if (layer && !m_shiftPressed && | 1440 if (layer && !m_shiftPressed && |
1441 !qobject_cast<TimeRulerLayer *>(layer)) { // don't snap to secs | 1441 !qobject_cast<TimeRulerLayer *>(layer)) { // don't snap to secs |
1442 layer->snapToFeatureFrame(this, snapFrame, | 1442 layer->snapToFeatureFrame(this, snapFrame, |
1443 resolution, Layer::SnapLeft); | 1443 resolution, Layer::SnapLeft, e->y()); |
1444 } | 1444 } |
1445 | 1445 |
1446 if (snapFrame < 0) snapFrame = 0; | 1446 if (snapFrame < 0) snapFrame = 0; |
1447 m_selectionStartFrame = snapFrame; | 1447 m_selectionStartFrame = snapFrame; |
1448 if (m_manager) { | 1448 if (m_manager) { |
2171 | 2171 |
2172 Layer *layer = getInteractionLayer(); | 2172 Layer *layer = getInteractionLayer(); |
2173 if (layer && !m_shiftPressed && | 2173 if (layer && !m_shiftPressed && |
2174 !qobject_cast<TimeRulerLayer *>(layer)) { // don't snap to secs | 2174 !qobject_cast<TimeRulerLayer *>(layer)) { // don't snap to secs |
2175 layer->snapToFeatureFrame(this, snapFrameLeft, | 2175 layer->snapToFeatureFrame(this, snapFrameLeft, |
2176 resolution, Layer::SnapLeft); | 2176 resolution, Layer::SnapLeft, e->y()); |
2177 layer->snapToFeatureFrame(this, snapFrameRight, | 2177 layer->snapToFeatureFrame(this, snapFrameRight, |
2178 resolution, Layer::SnapRight); | 2178 resolution, Layer::SnapRight, e->y()); |
2179 } | 2179 } |
2180 | 2180 |
2181 // cerr << "snap: frame = " << mouseFrame << ", start frame = " << m_selectionStartFrame << ", left = " << snapFrameLeft << ", right = " << snapFrameRight << endl; | 2181 // cerr << "snap: frame = " << mouseFrame << ", start frame = " << m_selectionStartFrame << ", left = " << snapFrameLeft << ", right = " << snapFrameRight << endl; |
2182 | 2182 |
2183 if (snapFrameLeft < 0) snapFrameLeft = 0; | 2183 if (snapFrameLeft < 0) snapFrameLeft = 0; |