ratkit 0.2.15

A comprehensive collection of reusable TUI components for ratatui including resizable splits, tree views, markdown rendering, toast notifications, dialogs, and terminal embedding
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Visual text-selection coordinates for rendered document viewers.

/// Position in rendered text using document-relative visual coordinates.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub struct SelectionPos {
    /// X coordinate, measured in rendered cells.
    pub x: i32,
    /// Y coordinate, relative to the rendered document start.
    pub y: i32,
}

impl SelectionPos {
    /// Creates a new rendered text position.
    pub fn new(x: i32, y: i32) -> Self {
        Self { x, y }
    }
}