diff options
author | Carl Hetherington <carl@carlh.net> | 2010-01-15 22:47:56 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-01-15 22:47:56 +0000 |
commit | e33d7a56b4e02a0886ddfce94222d877529aeee6 (patch) | |
tree | 1f48ae5611aa383cbeedaa0cd825658741ccdd5b /gtk2_ardour | |
parent | 11edfd035e19c90544bf10ff3845e8d7f7e80c5b (diff) |
Stop surprising autoscroll when trimming regions; hopefully addresses #2993.
git-svn-id: svn://localhost/ardour2/branches/3.0@6498 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 18 | ||||
-rw-r--r-- | gtk2_ardour/editor_drag.h | 4 |
2 files changed, 21 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index fb68e74e26..33b4b77f88 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -17,6 +17,8 @@ */ +#define __STDC_LIMIT_MACROS 1 +#include <stdint.h> #include "pbd/memento_command.h" #include "pbd/basename.h" #include "ardour/diskstream.h" @@ -1892,6 +1894,22 @@ TrimDrag::aborted () } } +pair<nframes64_t, nframes64_t> +TrimDrag::extent () const +{ + pair<nframes64_t, nframes64_t> e = make_pair (INT64_MAX, 0); + + for (list<RegionView*>::const_iterator i = _views.begin(); i != _views.end(); ++i) { + boost::shared_ptr<Region> r = (*i)->region (); + pair<nframes64_t, nframes64_t> const t = make_pair (r->position(), r->position() + r->length ()); + e.first = min (e.first, t.first); + e.second = max (e.second, t.second); + } + + return e; +} + + MeterMarkerDrag::MeterMarkerDrag (Editor* e, ArdourCanvas::Item* i, bool c) : Drag (e, i), _copy (c) diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h index 7347780019..119bcc34b1 100644 --- a/gtk2_ardour/editor_drag.h +++ b/gtk2_ardour/editor_drag.h @@ -224,7 +224,7 @@ public: RegionDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &); virtual ~RegionDrag () {} - std::pair<nframes64_t, nframes64_t> extent () const; + virtual std::pair<nframes64_t, nframes64_t> extent () const; protected: @@ -412,6 +412,8 @@ public: return false; } + std::pair<nframes64_t, nframes64_t> extent () const; + private: Operation _operation; |