mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-11 17:16:38 +01:00
use const ref to UIConfiguration::instance() to shorten lines a bit
This commit is contained in:
parent
ff08fbb969
commit
6fec78221f
1 changed files with 7 additions and 6 deletions
|
|
@ -2984,11 +2984,11 @@ Editor::snap_to_internal (MusicSample& start, RoundMode direction, SnapPref pref
|
||||||
check_best_snap(presnap, test, dist, best);
|
check_best_snap(presnap, test, dist, best);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const UIConfiguration& uic (UIConfiguration::instance());
|
||||||
|
|
||||||
/* check snap-to-region-{start/end/sync} */
|
/* check snap-to-region-{start/end/sync} */
|
||||||
if (
|
if ((pref == SnapToAny_Visual) && (uic.get_snap_to_region_start() || uic.get_snap_to_region_end() || uic.get_snap_to_region_sync())) {
|
||||||
(pref == SnapToAny_Visual) &&
|
|
||||||
(UIConfiguration::instance().get_snap_to_region_start() || UIConfiguration::instance().get_snap_to_region_end() || UIConfiguration::instance().get_snap_to_region_sync())
|
|
||||||
) {
|
|
||||||
if (!region_boundary_cache.empty()) {
|
if (!region_boundary_cache.empty()) {
|
||||||
|
|
||||||
vector<samplepos_t>::iterator prev = region_boundary_cache.begin();
|
vector<samplepos_t>::iterator prev = region_boundary_cache.begin();
|
||||||
|
|
@ -3016,17 +3016,18 @@ Editor::snap_to_internal (MusicSample& start, RoundMode direction, SnapPref pref
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check Grid */
|
/* check Grid */
|
||||||
if (UIConfiguration::instance().get_snap_to_grid() && (_grid_type != GridTypeNone)) {
|
if (uic.get_snap_to_grid() && (_grid_type != GridTypeNone)) {
|
||||||
MusicSample pre(presnap, 0);
|
MusicSample pre(presnap, 0);
|
||||||
MusicSample post = snap_to_grid (pre, direction, pref);
|
MusicSample post = snap_to_grid (pre, direction, pref);
|
||||||
check_best_snap(presnap, post.sample, dist, best);
|
check_best_snap(presnap, post.sample, dist, best);
|
||||||
|
cerr << best << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now check "magnetic" state: is the grid within reasonable on-screen distance to trigger a snap?
|
/* now check "magnetic" state: is the grid within reasonable on-screen distance to trigger a snap?
|
||||||
* this also helps to avoid snapping to somewhere the user can't see. (i.e.: I clicked on a region and it disappeared!!)
|
* this also helps to avoid snapping to somewhere the user can't see. (i.e.: I clicked on a region and it disappeared!!)
|
||||||
* ToDo: Perhaps this should only occur if EditPointMouse?
|
* ToDo: Perhaps this should only occur if EditPointMouse?
|
||||||
*/
|
*/
|
||||||
int snap_threshold_s = pixel_to_sample(UIConfiguration::instance().get_snap_threshold());
|
int snap_threshold_s = pixel_to_sample (uic.get_snap_threshold());
|
||||||
if (ensure_snap) {
|
if (ensure_snap) {
|
||||||
start.set (best, 0);
|
start.set (best, 0);
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue