summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-03-11 07:39:25 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2014-03-11 07:39:25 -0400
commit279aefc60e232475c771932744afc1304f0b92d5 (patch)
tree8f873ec7df1aee50cbdd839cebddf9ff2cb49cd5
parentc10896e984c4e7532920815fbb20fc9c7467aea8 (diff)
fix error in height computation of MIDI region views (FUDGE!) use Rectangle::set_outline_all() and avoid the removed integer version of ::set_outline_what()
-rw-r--r--gtk2_ardour/audio_streamview.cc2
-rw-r--r--gtk2_ardour/editor_drag.cc2
-rw-r--r--gtk2_ardour/ghostregion.cc2
-rw-r--r--gtk2_ardour/midi_region_view.cc22
4 files changed, 15 insertions, 13 deletions
diff --git a/gtk2_ardour/audio_streamview.cc b/gtk2_ardour/audio_streamview.cc
index 7b84219b75..6880c8be5b 100644
--- a/gtk2_ardour/audio_streamview.cc
+++ b/gtk2_ardour/audio_streamview.cc
@@ -289,7 +289,7 @@ AudioStreamView::setup_rec_box ()
rec_rect->set_y0 (1);
rec_rect->set_x1 (xend);
rec_rect->set_y1 (child_height ());
- rec_rect->set_outline_what (0);
+ rec_rect->set_outline_what (ArdourCanvas::Rectangle::What (0));
rec_rect->set_outline_color (ARDOUR_UI::config()->get_canvasvar_TimeAxisFrame());
rec_rect->set_fill_color (fill_color);
rec_rect->lower_to_bottom();
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 37ae7da461..56879fbaa0 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -4898,7 +4898,7 @@ NoteCreateDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
double const y = sv->note_to_y (sv->y_to_note (y_to_region (event->button.y)));
_drag_rect->set (ArdourCanvas::Rect (x, y, x, y + floor (_region_view->midi_stream_view()->note_height ())));
- _drag_rect->set_outline_what (0xff);
+ _drag_rect->set_outline_all ();
_drag_rect->set_outline_color (0xffffff99);
_drag_rect->set_fill_color (0xffffff66);
}
diff --git a/gtk2_ardour/ghostregion.cc b/gtk2_ardour/ghostregion.cc
index 3bdc690044..da2beeeca7 100644
--- a/gtk2_ardour/ghostregion.cc
+++ b/gtk2_ardour/ghostregion.cc
@@ -51,7 +51,7 @@ GhostRegion::GhostRegion (ArdourCanvas::Group* parent, TimeAxisView& tv, TimeAxi
base_rect->set_x0 (0);
base_rect->set_y0 (0.0);
base_rect->set_y1 (trackview.current_height() - 1.0);
- base_rect->set_outline_what (0);
+ base_rect->set_outline_what (ArdourCanvas::Rectangle::What (0));
if (!is_automation_ghost()) {
base_rect->hide();
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc
index 30ba3284d8..273ba0dbd7 100644
--- a/gtk2_ardour/midi_region_view.cc
+++ b/gtk2_ardour/midi_region_view.cc
@@ -1376,14 +1376,12 @@ MidiRegionView::reset_width_dependent_items (double pixel_width)
void
MidiRegionView::set_height (double height)
{
- static const double FUDGE = 2.0;
- const double old_height = _height;
+ double old_height = _height;
RegionView::set_height(height);
- _height = height - FUDGE;
- apply_note_range(midi_stream_view()->lowest_note(),
- midi_stream_view()->highest_note(),
- height != old_height + FUDGE);
+ apply_note_range (midi_stream_view()->lowest_note(),
+ midi_stream_view()->highest_note(),
+ height != old_height);
if (name_text) {
name_text->raise_to_top();
@@ -1520,8 +1518,9 @@ MidiRegionView::resolve_note(uint8_t note, double end_time)
const framepos_t end_time_frames = region_beats_to_region_frames(end_time);
_active_notes[note]->set_x1 (trackview.editor().sample_to_pixel(end_time_frames));
- _active_notes[note]->set_outline_what (0xf);
+ _active_notes[note]->set_outline_all ();
_active_notes[note] = 0;
+
}
}
@@ -1651,15 +1650,18 @@ MidiRegionView::update_note (Note* ev, bool update_ghost_regions)
Note* const old_rect = _active_notes[note->note()];
boost::shared_ptr<NoteType> old_note = old_rect->note();
old_rect->set_x1 (x);
- old_rect->set_outline_what (0xF);
+ old_rect->set_outline_all ();
}
_active_notes[note->note()] = ev;
}
/* outline all but right edge */
- ev->set_outline_what (0x1 & 0x4 & 0x8);
+ ev->set_outline_what (ArdourCanvas::Rectangle::What (
+ ArdourCanvas::Rectangle::TOP|
+ ArdourCanvas::Rectangle::LEFT|
+ ArdourCanvas::Rectangle::BOTTOM));
} else {
/* outline all edges */
- ev->set_outline_what (0xF);
+ ev->set_outline_all ();
}
if (update_ghost_regions) {