Use API to consistently calculate region pixel boundaries

This commit is contained in:
Robin Gareus
2024-11-28 14:59:24 +01:00
parent d44ceb3ab7
commit 6e9be294a1
2 changed files with 2 additions and 5 deletions

View File

@@ -1033,7 +1033,7 @@ RegionView::update_coverage_frame (LayerDisplay d)
if (cr) {
/* finish off the last rectangle */
cr->set_x1 (trackview.editor().duration_to_pixels (position.distance (end)));
cr->set_x1 (trackview.editor().time_delta_to_pixel (position, end));
}
if (frame_handle_start) {

View File

@@ -799,10 +799,7 @@ TimeAxisViewItem::set_samples_per_pixel (double fpp)
samples_per_pixel = fpp;
set_position (this->get_position(), this);
double end_pixel = trackview.editor().time_to_pixel (time_position + get_duration());
double first_pixel = trackview.editor().time_to_pixel (time_position);
reset_width_dependent_items (end_pixel - first_pixel);
reset_width_dependent_items (trackview.editor().time_delta_to_pixel (time_position, time_position + get_duration()));
}
void