Skip to main content

rofd_editor/
cursor.rs

1use rofd_dom::AnnotationId;
2
3#[derive(Debug, Clone, PartialEq)]
4pub struct TextCursor {
5    pub annotation: AnnotationId,
6    pub offset: usize,
7    pub preferred_x: Option<f32>,
8}
9
10#[cfg(test)]
11mod tests {
12    use super::*;
13
14    #[test]
15    fn cursor_clone_eq() {
16        let c = TextCursor {
17            annotation: AnnotationId::from_int(1),
18            offset: 3,
19            preferred_x: Some(1.0),
20        };
21        assert_eq!(c, c.clone());
22    }
23}