mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
smooth visual curve drawing
This commit is contained in:
parent
38891288f3
commit
fed5599baa
6 changed files with 31 additions and 46 deletions
|
|
@ -188,18 +188,9 @@ Curve::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
|
|||
/* draw line between samples */
|
||||
window_space = item_to_window (Duple (samples[left].x, samples[left].y));
|
||||
context->move_to (window_space.x, window_space.y);
|
||||
Coord last_x = round(window_space.x);
|
||||
Coord last_y = round(window_space.y);
|
||||
for (uint32_t idx = left + 1; idx < right; ++idx) {
|
||||
window_space = item_to_window (Duple (samples[idx].x, samples[idx].y));
|
||||
if (last_x == round(window_space.x)) continue;
|
||||
if (last_y == round(window_space.y)) continue;
|
||||
last_x = round(window_space.x);
|
||||
last_y = round(window_space.y);
|
||||
context->line_to (last_x - .5 , last_y + .5);
|
||||
}
|
||||
if (last_x != round(window_space.x) || last_y != round(window_space.y)) {
|
||||
context->line_to (window_space.x - .5 , window_space.y + .5);
|
||||
context->line_to (window_space.x, window_space.y);
|
||||
}
|
||||
|
||||
switch (curve_fill) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue