File tree 2 files changed +3
-6
lines changed 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ pub fn from_flexbox_layout(
59
59
size : from_val_size ( scale_factor, value. size_constraints . suggested ) ,
60
60
min_size : from_val_size ( scale_factor, value. size_constraints . min ) ,
61
61
max_size : from_val_size ( scale_factor, value. size_constraints . max ) ,
62
- aspect_ratio : match value. flexbox_layout . aspect_ratio {
62
+ aspect_ratio : match value. size_constraints . aspect_ratio {
63
63
Some ( value) => taffy:: number:: Number :: Defined ( value) ,
64
64
None => taffy:: number:: Number :: Undefined ,
65
65
} ,
Original file line number Diff line number Diff line change 1
- #![ warn( missing_docs) ]
2
-
3
1
//! Components used to control the layout of [`UiNode`] entities.
4
2
use crate :: { Size , UiRect , Val } ;
5
3
use bevy_derive:: { Deref , DerefMut } ;
@@ -71,6 +69,8 @@ pub struct SizeConstraints {
71
69
pub suggested : Size < Val > ,
72
70
/// The maximum extent, which cannot be violated by the layouting algorithm
73
71
pub max : Size < Val > ,
72
+ /// The expected aspect ratio, computed as width / height
73
+ pub aspect_ratio : Option < f32 > ,
74
74
}
75
75
76
76
/// The space around and inside of a UI node
@@ -205,8 +205,6 @@ pub mod flex {
205
205
pub shrink : f32 ,
206
206
/// The initial size of the item
207
207
pub basis : Val ,
208
- /// The aspect ratio of the flexbox
209
- pub aspect_ratio : Option < f32 > ,
210
208
}
211
209
212
210
impl Default for FlexboxLayout {
@@ -220,7 +218,6 @@ pub mod flex {
220
218
grow : 0.0 ,
221
219
shrink : 1.0 ,
222
220
basis : Val :: Auto ,
223
- aspect_ratio : Default :: default ( ) ,
224
221
}
225
222
}
226
223
}
You can’t perform that action at this time.
0 commit comments