mirror of
https://gitlab.freedesktop.org/dabrain34/GstPipelineStudio.git
synced 2025-03-07 03:21:12 +00:00
graphview: update node API
Update doc for `node` and take u32 in argument.
This commit is contained in:
parent
c7c8817f9d
commit
9ef073d3c3
1 changed files with 6 additions and 4 deletions
|
@ -477,10 +477,12 @@ impl GraphView {
|
|||
.collect();
|
||||
nodes_list
|
||||
}
|
||||
|
||||
pub fn node(&self, id: &u32) -> Option<super::node::Node> {
|
||||
/// Get the node with the specified node id inside the graphview.
|
||||
///
|
||||
/// Returns `None` if the node is not in the graphview.
|
||||
pub fn node(&self, id: u32) -> Option<Node> {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
private.nodes.borrow().get(id).cloned()
|
||||
private.nodes.borrow().get(&id).cloned()
|
||||
}
|
||||
|
||||
pub fn remove_all_nodes(&self) {
|
||||
|
@ -982,7 +984,7 @@ impl GraphView {
|
|||
let id = node.id();
|
||||
let position = node.position();
|
||||
self.add_node(id, node);
|
||||
if let Some(node) = self.node(&id) {
|
||||
if let Some(node) = self.node(id) {
|
||||
self.move_node(&node.upcast(), position.0, position.1);
|
||||
}
|
||||
self.update_current_node_id(id);
|
||||
|
|
Loading…
Reference in a new issue