mirror of
https://gitlab.freedesktop.org/pipewire/helvum
synced 2026-03-15 11:36:11 +08:00
Prevent nodes from being dragged out of the graph view
This commit is contained in:
@@ -257,7 +257,8 @@ impl GraphView {
|
|||||||
.expect("Failed to cast to FixedLayout");
|
.expect("Failed to cast to FixedLayout");
|
||||||
|
|
||||||
let transform = gsk::Transform::new()
|
let transform = gsk::Transform::new()
|
||||||
.translate(&graphene::Point::new(x, y))
|
// Nodes should not be able to be dragged out of the view, so we use `max(coordinate, 0.0)` to prevent that.
|
||||||
|
.translate(&graphene::Point::new(f32::max(x, 0.0), f32::max(y, 0.0)))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
layout_manager
|
layout_manager
|
||||||
|
|||||||
Reference in New Issue
Block a user