rootvg_text/
primitive.rs

1use rootvg_core::color::RGBA8;
2use rootvg_core::math::{Point, Size};
3
4use super::RcTextBuffer;
5
6#[derive(Debug, Clone, PartialEq)]
7pub struct TextPrimitive {
8    pub buffer: RcTextBuffer,
9    pub pos: Point,
10    pub color: RGBA8,
11    pub bounds_size: Size,
12}
13
14impl TextPrimitive {
15    pub fn new(buffer: RcTextBuffer, pos: Point, color: RGBA8) -> Self {
16        let bounds_size = buffer.bounds_size();
17
18        Self {
19            buffer,
20            pos,
21            color,
22            bounds_size,
23        }
24    }
25}