tessera_ui_basic_components/pipelines/text/
command.rs

1use tessera_ui::DrawCommand;
2
3use super::TextData;
4
5pub struct TextCommand {
6    pub data: TextData,
7}
8
9impl DrawCommand for TextCommand {
10    fn barrier(&self) -> Option<tessera_ui::BarrierRequirement> {
11        // No specific barrier requirements for text commands
12        None
13    }
14}
15
16/// Describes size constraints for a text draw
17#[derive(Debug, PartialEq)]
18pub struct TextConstraint {
19    /// Maximum width of the text
20    /// If None, it will be calculated by the text renderer
21    pub max_width: Option<f32>,
22    /// Maximum height of the text
23    /// If None, it will be calculated by the text renderer
24    pub max_height: Option<f32>,
25}
26
27impl TextConstraint {
28    /// Creates a new `TextConstraint` with no limits.
29    pub const NONE: Self = Self {
30        max_width: None,
31        max_height: None,
32    };
33}