mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-01 03:17:39 +01:00
When setting the duration of a TimeAxisViewItem, do not round before computing pixel width
Conflicts: gtk2_ardour/time_axis_view_item.cc
This commit is contained in:
parent
4b1bbd11d1
commit
9cd261f8d5
1 changed files with 12 additions and 3 deletions
|
|
@ -431,7 +431,6 @@ TimeAxisViewItem::set_position(framepos_t pos, void* src, double* delta)
|
|||
}
|
||||
|
||||
group->set_x_position (new_unit_pos);
|
||||
|
||||
PositionChanged (frame_position, src); /* EMIT_SIGNAL */
|
||||
|
||||
return true;
|
||||
|
|
@ -469,7 +468,10 @@ TimeAxisViewItem::set_duration (framecnt_t dur, void* src)
|
|||
|
||||
item_duration = dur;
|
||||
|
||||
reset_width_dependent_items (trackview.editor().sample_to_pixel (dur));
|
||||
double end_pixel = trackview.editor().sample_to_pixel (frame_position + dur);
|
||||
double first_pixel = trackview.editor().sample_to_pixel (frame_position);
|
||||
|
||||
reset_width_dependent_items (end_pixel - first_pixel);
|
||||
|
||||
DurationChanged (dur, src); /* EMIT_SIGNAL */
|
||||
return true;
|
||||
|
|
@ -1105,7 +1107,11 @@ TimeAxisViewItem::set_samples_per_pixel (double fpp)
|
|||
{
|
||||
samples_per_pixel = fpp;
|
||||
set_position (this->get_position(), this);
|
||||
reset_width_dependent_items ((double) get_duration() / samples_per_pixel);
|
||||
|
||||
double end_pixel = trackview.editor().sample_to_pixel (frame_position + get_duration());
|
||||
double first_pixel = trackview.editor().sample_to_pixel (frame_position);
|
||||
|
||||
reset_width_dependent_items (end_pixel - first_pixel);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1135,6 +1141,9 @@ TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
|
|||
|
||||
if (frame) {
|
||||
frame->show();
|
||||
/* Note: x0 is always zero - the position is defined by
|
||||
* the position of the group, not the frame.
|
||||
*/
|
||||
frame->set_x1 (pixel_width + RIGHT_EDGE_SHIFT);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue