Line up percussion hits correctly.

git-svn-id: svn://localhost/ardour2/trunk@2241 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard
2007-08-04 15:51:04 +00:00
parent a5abcd306b
commit 2f7bb09453
2 changed files with 3 additions and 3 deletions

View File

@@ -26,7 +26,7 @@ Diamond::Diamond(Group& group, double height)
: Polygon(group)
{
Points points;
points.push_back(Point(0, height*2));
points.push_back(Point(0, height*2.0));
points.push_back(Point(height, height));
points.push_back(Point(0, 0));
points.push_back(Point(-height, height));

View File

@@ -507,7 +507,7 @@ MidiRegionView::add_event (const MidiEvent& ev)
const Byte& note = ev.buffer()[1];
const double diamond_size = midi_stream_view()->note_height() / 2.0;
const double x = trackview.editor.frame_to_pixel((nframes_t)ev.time());
const double y = midi_stream_view()->note_to_y(note) + (diamond_size / 2.0);
const double y = midi_stream_view()->note_to_y(note) + ((diamond_size-2) / 4.0);
CanvasHit* ev_diamond = new CanvasHit(*this, *group, diamond_size);
ev_diamond->move(x, y);
@@ -574,7 +574,7 @@ MidiRegionView::add_note (const MidiModel::Note& note)
} else if (midi_view()->note_mode() == Percussive) {
const double diamond_size = midi_stream_view()->note_height() / 2.0;
const double x = trackview.editor.frame_to_pixel((nframes_t)note.time());
const double y = midi_stream_view()->note_to_y(note.note()) + (diamond_size / 2.0) - 2;
const double y = midi_stream_view()->note_to_y(note.note()) + ((diamond_size-2) / 4.0);
CanvasHit* ev_diamond = new CanvasHit(*this, *group, diamond_size);
ev_diamond->move(x, y);