mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 16:46:35 +01:00
Curve: anti-aliasing.
use cairo for anti-aliasing, and ignore explicit Catmull-Rom points for that fall on the same x-cordinate.
This commit is contained in:
parent
d9b7c8b864
commit
c03b658531
1 changed files with 4 additions and 1 deletions
|
|
@ -383,9 +383,12 @@ Curve::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
|
||||||
/* draw line between samples */
|
/* draw line between samples */
|
||||||
window_space = item_to_window (Duple (samples[left].x, samples[left].y));
|
window_space = item_to_window (Duple (samples[left].x, samples[left].y));
|
||||||
context->move_to (window_space.x, window_space.y);
|
context->move_to (window_space.x, window_space.y);
|
||||||
|
Coord last_x = round(window_space.x);
|
||||||
for (uint32_t idx = left + 1; idx < right; ++idx) {
|
for (uint32_t idx = left + 1; idx < right; ++idx) {
|
||||||
window_space = item_to_window (Duple (samples[idx].x, samples[idx].y));
|
window_space = item_to_window (Duple (samples[idx].x, samples[idx].y));
|
||||||
context->line_to (window_space.x, window_space.y);
|
if (last_x == round(window_space.x)) continue;
|
||||||
|
last_x = round(window_space.x);
|
||||||
|
context->line_to (last_x - .5 , window_space.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (curve_fill) {
|
switch (curve_fill) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue