Skip to main content

euv_core/scene/selection/
struct.rs

1use super::*;
2
3/// Active single-node or cross-node character-range text selection targeting live selectable `NodeKind::Text` nodes.
4#[derive(Clone, Copy, Data, Debug, Eq, New, PartialEq)]
5pub struct SelectionState {
6    /// Scene node where the selection anchor started.
7    #[get(type(copy))]
8    pub(crate) anchor_node: NodeId,
9    /// Inclusive character index inside `anchor_node` where selection started.
10    #[get(type(copy))]
11    pub(crate) anchor_char: usize,
12    /// Active scene node where selection currently ends.
13    #[get(type(copy))]
14    pub(crate) focus_node: NodeId,
15    /// Active character index inside `focus_node` where selection currently ends.
16    #[get(type(copy))]
17    pub(crate) focus_char: usize,
18}