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()

This commit is contained in:
Paul Davis
2014-03-11 07:39:25 -04:00
parent c10896e984
commit 279aefc60e
4 changed files with 15 additions and 13 deletions

View File

@@ -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();

View File

@@ -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);
}

View File

@@ -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();

View File

@@ -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) {