#[repr(C)]pub struct NodeId { /* private fields */ }
Expand description
Identifier for a Node.
IDs must be unique within the editor context. Generated using IdentifierGenerator::next_node.
Implementations§
Source§impl NodeId
impl NodeId
Sourcepub fn set_draggable(&self, draggable: bool) -> &Self
pub fn set_draggable(&self, draggable: bool) -> &Self
Sets whether this node can be dragged by the user.
Sourcepub fn move_editor_to(&self) -> &Self
pub fn move_editor_to(&self) -> &Self
Pans the editor view to center on this node.
Sourcepub fn get_dimensions(&self) -> ImVec2
pub fn get_dimensions(&self) -> ImVec2
Gets the dimensions (width, height) of this node.
Note: This must be called after the node has been submitted in the current frame, otherwise the dimensions might be outdated or zero.
Sourcepub fn set_position(
&self,
x: f32,
y: f32,
coordinate_system: CoordinateSystem,
) -> &Self
pub fn set_position( &self, x: f32, y: f32, coordinate_system: CoordinateSystem, ) -> &Self
Sets the position of the top-left corner of this node in the specified coordinate system.
Sourcepub fn get_position(&self, coordinate_system: CoordinateSystem) -> ImVec2
pub fn get_position(&self, coordinate_system: CoordinateSystem) -> ImVec2
Gets the position of the top-left corner of this node in the specified coordinate system.
Note: This must be called after the node has been submitted in the current frame, otherwise the position might be outdated.
Sourcepub fn snap_to_grid(&self) -> &Self
pub fn snap_to_grid(&self) -> &Self
Aligns the node’s top-left corner to the grid lines.
Requires the StyleFlags::GridSnapping
flag to be enabled in the style.
Sourcepub fn deselect(&self) -> &Self
pub fn deselect(&self) -> &Self
Deselects this node.
If no other nodes are selected, this is equivalent to EditorContext::clear_node_selection
.
Sourcepub fn is_selected(&self) -> bool
pub fn is_selected(&self) -> bool
Checks if this node is currently selected.
Trait Implementations§
Source§impl Hoverable for NodeId
impl Hoverable for NodeId
Source§fn is_hovered(&self, _scope: &OuterScope) -> bool
fn is_hovered(&self, _scope: &OuterScope) -> bool
Checks if the node is hovered.