mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
fix height of xfade rendering
git-svn-id: svn://localhost/ardour2/branches/3.0@12239 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
da7215e1ad
commit
68e69a8b29
1 changed files with 10 additions and 8 deletions
|
|
@ -1571,19 +1571,20 @@ AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, frame
|
||||||
|
|
||||||
Points* points = get_canvas_points ("xfade edit redraw", npoints);
|
Points* points = get_canvas_points ("xfade edit redraw", npoints);
|
||||||
boost::scoped_ptr<float> vec (new float[npoints]);
|
boost::scoped_ptr<float> vec (new float[npoints]);
|
||||||
|
double effective_height = _height - NAME_HIGHLIGHT_SIZE;
|
||||||
|
|
||||||
ar->fade_in()->curve().get_vector (0, ar->fade_in()->back()->when, vec.get(), npoints);
|
ar->fade_in()->curve().get_vector (0, ar->fade_in()->back()->when, vec.get(), npoints);
|
||||||
|
|
||||||
for (int i = 0, pci = 0; i < npoints; ++i) {
|
for (int i = 0, pci = 0; i < npoints; ++i) {
|
||||||
Gnome::Art::Point &p ((*points)[pci++]);
|
Gnome::Art::Point &p ((*points)[pci++]);
|
||||||
p.set_x (i);
|
p.set_x (i);
|
||||||
p.set_y (_height - (_height * vec.get()[i]));
|
p.set_y (effective_height - (effective_height * vec.get()[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
start_xfade_rect->property_x1() = ((*points)[0]).get_x();
|
start_xfade_rect->property_x1() = ((*points)[0]).get_x();
|
||||||
start_xfade_rect->property_y1() = 0;
|
start_xfade_rect->property_y1() = 0;
|
||||||
start_xfade_rect->property_x2() = ((*points)[npoints-1]).get_x();
|
start_xfade_rect->property_x2() = ((*points)[npoints-1]).get_x();
|
||||||
start_xfade_rect->property_y2() = _height;
|
start_xfade_rect->property_y2() = effective_height;
|
||||||
start_xfade_rect->show ();
|
start_xfade_rect->show ();
|
||||||
start_xfade_rect->raise_to_top ();
|
start_xfade_rect->raise_to_top ();
|
||||||
|
|
||||||
|
|
@ -1600,7 +1601,7 @@ AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, frame
|
||||||
for (int i = 0, pci = 0; i < npoints; ++i) {
|
for (int i = 0, pci = 0; i < npoints; ++i) {
|
||||||
Gnome::Art::Point &p ((*points)[pci++]);
|
Gnome::Art::Point &p ((*points)[pci++]);
|
||||||
p.set_x (i);
|
p.set_x (i);
|
||||||
p.set_y (_height - (_height * (1.0 - vec.get()[i])));
|
p.set_y (effective_height - (effective_height * (1.0 - vec.get()[i])));
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1610,7 +1611,7 @@ AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, frame
|
||||||
for (int i = 0, pci = 0; i < npoints; ++i) {
|
for (int i = 0, pci = 0; i < npoints; ++i) {
|
||||||
Gnome::Art::Point &p ((*points)[pci++]);
|
Gnome::Art::Point &p ((*points)[pci++]);
|
||||||
p.set_x (i);
|
p.set_x (i);
|
||||||
p.set_y (_height - (_height * vec.get()[i]));
|
p.set_y (effective_height - (effective_height * vec.get()[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1670,17 +1671,18 @@ AudioRegionView::redraw_end_xfade_to (boost::shared_ptr<AudioRegion> ar, framecn
|
||||||
ar->fade_out()->curve().get_vector (0, ar->fade_out()->back()->when, vec.get(), npoints);
|
ar->fade_out()->curve().get_vector (0, ar->fade_out()->back()->when, vec.get(), npoints);
|
||||||
|
|
||||||
double rend = trackview.editor().frame_to_pixel (_region->length() - len);
|
double rend = trackview.editor().frame_to_pixel (_region->length() - len);
|
||||||
|
double effective_height = _height - NAME_HIGHLIGHT_SIZE;
|
||||||
|
|
||||||
for (int i = 0, pci = 0; i < npoints; ++i) {
|
for (int i = 0, pci = 0; i < npoints; ++i) {
|
||||||
Gnome::Art::Point &p ((*points)[pci++]);
|
Gnome::Art::Point &p ((*points)[pci++]);
|
||||||
p.set_x (rend + i);
|
p.set_x (rend + i);
|
||||||
p.set_y (_height - (_height * vec.get()[i]));
|
p.set_y (effective_height - (effective_height * vec.get()[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
end_xfade_rect->property_x1() = ((*points)[0]).get_x();
|
end_xfade_rect->property_x1() = ((*points)[0]).get_x();
|
||||||
end_xfade_rect->property_y1() = 0;
|
end_xfade_rect->property_y1() = 0;
|
||||||
end_xfade_rect->property_x2() = ((*points)[npoints-1]).get_x();
|
end_xfade_rect->property_x2() = ((*points)[npoints-1]).get_x();
|
||||||
end_xfade_rect->property_y2() = _height;
|
end_xfade_rect->property_y2() = effective_height;
|
||||||
end_xfade_rect->show ();
|
end_xfade_rect->show ();
|
||||||
end_xfade_rect->raise_to_top ();
|
end_xfade_rect->raise_to_top ();
|
||||||
|
|
||||||
|
|
@ -1707,7 +1709,7 @@ AudioRegionView::redraw_end_xfade_to (boost::shared_ptr<AudioRegion> ar, framecn
|
||||||
for (int i = 0, pci = 0; i < npoints; ++i) {
|
for (int i = 0, pci = 0; i < npoints; ++i) {
|
||||||
Gnome::Art::Point &p ((*points)[pci++]);
|
Gnome::Art::Point &p ((*points)[pci++]);
|
||||||
p.set_x (rend + i);
|
p.set_x (rend + i);
|
||||||
p.set_y (_height - (_height * vec.get()[i]));
|
p.set_y (effective_height - (effective_height * vec.get()[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue