Simple velocity example

This commit is contained in:
2025-11-02 10:49:25 +01:00
parent f5d1b42db4
commit 68d00be96c
3 changed files with 47 additions and 8 deletions
+8 -1
View File
@@ -139,12 +139,19 @@ impl Transform {
}
/// Sets constant dimensions.
pub fn dimensions(mut self, width: u16, height: u16) -> Self {
pub fn dimensions_const(mut self, width: u16, height: u16) -> Self {
self.width = Dimension::Const(width);
self.height = Dimension::Const(height);
self
}
/// Sets constant dimensions.
pub fn dimensions(mut self, width: Dimension, height: Dimension) -> Self {
self.width = width;
self.height = height;
self
}
/// Resolves `Dimension` rules into absolute values for the given parent size.
pub fn use_dimensions(&self, parent_transform: &RawTransform, raw: &mut RawTransform) {
self.width