Simple velocity example
This commit is contained in:
+8
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user