summaryrefslogtreecommitdiff
path: root/gtk2_ardour/automation_line.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-08-06 23:28:44 +0000
committerCarl Hetherington <carl@carlh.net>2010-08-06 23:28:44 +0000
commitc06c6c153db6b33b93515100d839f376dc805d5d (patch)
treef550c01eed93591a6492e96c0b164033638ba864 /gtk2_ardour/automation_line.cc
parentc333b19422c3cf0964ea09f5133b3222d85dd8eb (diff)
Fix up selection of automation points.
git-svn-id: svn://localhost/ardour2/branches/3.0@7556 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/automation_line.cc')
-rw-r--r--gtk2_ardour/automation_line.cc24
1 files changed, 9 insertions, 15 deletions
diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc
index ead6a2b56d..eca2b705ce 100644
--- a/gtk2_ardour/automation_line.cc
+++ b/gtk2_ardour/automation_line.cc
@@ -950,28 +950,24 @@ AutomationLine::remove_point (ControlPoint& cp)
/** Get selectable points within an area.
* @param start Start position in session frames.
* @param end End position in session frames.
- * @param botfrac Bottom of area, as a fraction of the line height.
- * @param topfrac Bottom of area, as a fraction of the line height.
+ * @param bot Bottom y range, as a fraction of line height, where 0 is the bottom of the line.
+ * @param top Top y range, as a fraction of line height, where 0 is the bottom of the line.
+ * @param result Filled in with selectable things.
*/
void
AutomationLine::get_selectables (
framepos_t start, framepos_t end, double botfrac, double topfrac, list<Selectable*>& results
)
{
-
- double top;
- double bot;
-
/* these two are in AutomationList model coordinates */
double nstart;
double nend;
bool collecting = false;
- /* Curse X11 and its inverted coordinate system! */
-
- bot = (1.0 - topfrac) * _height;
- top = (1.0 - botfrac) * _height;
+ /* convert fractions to display coordinates with 0 at the top of the track */
+ double const bot_track = (1 - topfrac) * trackview.current_height ();
+ double const top_track = (1 - botfrac) * trackview.current_height ();
nstart = DBL_MAX;
nend = 0;
@@ -982,7 +978,7 @@ AutomationLine::get_selectables (
if (session_frames_when >= start && session_frames_when <= end) {
- if ((*i)->get_y() >= bot && (*i)->get_y() <= top) {
+ if ((*i)->get_y() >= bot_track && (*i)->get_y() <= top_track) {
(*i)->show();
(*i)->set_visible(true);
@@ -1027,10 +1023,8 @@ AutomationLine::point_selection_to_control_points (PointSelection const & s)
continue;
}
- /* Curse X11 and its inverted coordinate system! */
-
- double const bot = (1.0 - i->high_fract) * _height;
- double const top = (1.0 - i->low_fract) * _height;
+ double const bot = (1 - i->high_fract) * trackview.current_height ();
+ double const top = (1 - i->low_fract) * trackview.current_height ();
for (vector<ControlPoint*>::iterator j = control_points.begin(); j != control_points.end(); ++j) {