mirror of
https://gitlab.freedesktop.org/pipewire/helvum.git
synced 2026-05-07 12:18:03 +02:00
Prevent nodes from being dragged out of the graph view
This commit is contained in:
parent
ec8de4a4a7
commit
5ac535ab37
1 changed files with 2 additions and 1 deletions
|
|
@ -257,7 +257,8 @@ impl GraphView {
|
|||
.expect("Failed to cast to FixedLayout");
|
||||
|
||||
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();
|
||||
|
||||
layout_manager
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue