use tessera_ui::DrawCommand;
use super::pipeline::TextData;
#[derive(Debug, Clone, PartialEq)]
pub struct TextCommand {
pub data: TextData,
}
impl DrawCommand for TextCommand {
fn barrier(&self) -> Option<tessera_ui::BarrierRequirement> {
None
}
}
#[derive(Debug, PartialEq, Clone)]
pub struct TextConstraint {
pub max_width: Option<f32>,
pub max_height: Option<f32>,
}
impl std::hash::Hash for TextConstraint {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
if let Some(w) = self.max_width {
w.to_bits().hash(state);
} else {
0u32.hash(state); }
if let Some(h) = self.max_height {
h.to_bits().hash(state);
} else {
0u32.hash(state); }
}
}
impl TextConstraint {
pub const NONE: Self = Self {
max_width: None,
max_height: None,
};
}