drop use of Editor::sample_to_pixel_unrounded() in some cases

We want things rounded to the nearest pixel in these (and perhaps all) cases.
This commit is contained in:
Paul Davis 2023-06-15 20:06:49 -06:00
parent a7c21de229
commit de334c14b1
2 changed files with 5 additions and 5 deletions

View File

@ -66,11 +66,11 @@ GridLines::draw (std::vector<Ruler::Mark> const & marks)
samplepos_t s = m.position;
if (m.style == ArdourCanvas::Ruler::Mark::Major) {
lines.add_coord (PublicEditor::instance().sample_to_pixel_unrounded (s), 1.0, major_color);
lines.add_coord (PublicEditor::instance().sample_to_pixel (s), 1.0, major_color);
} else if (m.style == ArdourCanvas::Ruler::Mark::Minor) {
lines.add_coord (PublicEditor::instance().sample_to_pixel_unrounded (s), 1.0, minor_color);
lines.add_coord (PublicEditor::instance().sample_to_pixel (s), 1.0, minor_color);
} else {
lines.add_coord (PublicEditor::instance().sample_to_pixel_unrounded (s), 1.0, micro_color);
lines.add_coord (PublicEditor::instance().sample_to_pixel (s), 1.0, micro_color);
}
}
}

View File

@ -2505,8 +2505,8 @@ MidiRegionView::update_drag_selection(timepos_t const & start, timepos_t const &
// Convert to local coordinates
const double y = midi_view()->y_position();
const double x0 = editor.sample_to_pixel (max<samplepos_t>(0, _region->region_relative_position (start).samples()));
const double x1 = editor.sample_to_pixel (max<samplepos_t>(0, _region->region_relative_position (end).samples()));
const double x0 = editor.sample_to_pixel_unrounded (max<samplepos_t>(0, _region->region_relative_position (start).samples()));
const double x1 = editor.sample_to_pixel_unrounded (max<samplepos_t>(0, _region->region_relative_position (end).samples()));
const double y0 = max(0.0, gy0 - y);
const double y1 = max(0.0, gy1 - y);