mirror of
https://gitlab.freedesktop.org/pipewire/helvum
synced 2026-03-15 03:26:10 +08:00
Render links as a curve instead of a straight line
This commit is contained in:
@@ -60,13 +60,18 @@ fn draw(
|
|||||||
for link in links.borrow().values() {
|
for link in links.borrow().values() {
|
||||||
let (from_alloc, to_alloc) = get_allocs(nodes.clone(), link);
|
let (from_alloc, to_alloc) = get_allocs(nodes.clone(), link);
|
||||||
|
|
||||||
|
let from_x: f64 = (from_alloc.x + from_alloc.width).into();
|
||||||
|
let from_y: f64 = (from_alloc.y + (from_alloc.height / 2)).into();
|
||||||
cr.move_to(
|
cr.move_to(
|
||||||
(from_alloc.x + from_alloc.width).into(),
|
from_x, from_y
|
||||||
(from_alloc.y + (from_alloc.height / 2)).into(),
|
|
||||||
);
|
);
|
||||||
cr.line_to(
|
|
||||||
to_alloc.x.into(),
|
let to_x: f64 = to_alloc.x.into();
|
||||||
(to_alloc.y + (to_alloc.height / 2)).into(),
|
let to_y: f64 = (to_alloc.y + (to_alloc.height / 2)).into();
|
||||||
|
cr.curve_to(
|
||||||
|
from_x + 75.0, from_y,
|
||||||
|
to_x - 75.0, to_y,
|
||||||
|
to_x, to_y
|
||||||
);
|
);
|
||||||
|
|
||||||
cr.stroke();
|
cr.stroke();
|
||||||
|
|||||||
Reference in New Issue
Block a user