diff options
author | Carl Hetherington <carl@carlh.net> | 2011-12-29 22:14:15 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-12-29 22:14:15 +0000 |
commit | b1775149307a157444c516693ad6b98a404ef1b2 (patch) | |
tree | ffdf04d8396cf53d5378c073a8d249150d5282eb /gtk2_ardour/crossfade_view.cc | |
parent | cabb76cce6203d34299136371078bd20b6abe1e3 (diff) |
Revert internals of the last layering-related commit, and go back a slightly-cleaned-up version of how it was before. Remove all layering modes; only option now is add-is-higher. Move-add-higher could easily be re-added if anyone uses it.
git-svn-id: svn://localhost/ardour2/branches/3.0@11111 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/crossfade_view.cc')
-rw-r--r-- | gtk2_ardour/crossfade_view.cc | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/gtk2_ardour/crossfade_view.cc b/gtk2_ardour/crossfade_view.cc index 6db53e9440..10792e0a93 100644 --- a/gtk2_ardour/crossfade_view.cc +++ b/gtk2_ardour/crossfade_view.cc @@ -57,7 +57,8 @@ CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent, crossfade (xf), left_view (lview), right_view (rview), - _all_in_view (false) + _all_in_view (false), + _child_height (0) { _valid = true; _visible = true; @@ -109,13 +110,15 @@ CrossfadeView::reset_width_dependent_items (double pixel_width) } void -CrossfadeView::set_height (double h) +CrossfadeView::set_heights (double fade_height, double child_height) { - if (h > TimeAxisView::preset_height (HeightSmall)) { - h -= NAME_HIGHLIGHT_SIZE; + if (child_height > TimeAxisViewItem::NAME_HIGHLIGHT_THRESH) { + fade_height -= NAME_HIGHLIGHT_SIZE; + child_height -= NAME_HIGHLIGHT_SIZE; } - TimeAxisViewItem::set_height (h); + TimeAxisViewItem::set_height (fade_height); + _child_height = child_height; redraw_curves (); } @@ -203,7 +206,9 @@ CrossfadeView::redraw_curves () for (int i = 0, pci = 0; i < npoints; ++i) { Art::Point &p = (*points)[pci++]; p.set_x (xoff + i + 1); - p.set_y (_height - ((_height - 2) * vec[i])); + + double const ho = crossfade->in()->layer() > crossfade->out()->layer() ? _child_height : _height; + p.set_y (ho - ((_child_height - 2) * vec[i])); } fade_in->property_points() = *points; @@ -213,7 +218,9 @@ CrossfadeView::redraw_curves () for (int i = 0, pci = 0; i < npoints; ++i) { Art::Point &p = (*points)[pci++]; p.set_x (xoff + i + 1); - p.set_y (_height - ((_height - 2) * vec[i])); + + double const ho = crossfade->in()->layer() < crossfade->out()->layer() ? _child_height : _height; + p.set_y (ho - ((_child_height - 2) * vec[i])); } fade_out->property_points() = *points; |