Add aspectRatio style property
Summary: Implement aspect ratio as part of Yoga. Aspect ratio allows users of the library to specify the size of the undefined dimension in terms of an aspect ratio. See test cases for examples. Reviewed By: gkassabli Differential Revision: D4211458 fbshipit-source-id: f8d0d318369c7b529ee29e61a52b17d0cf3b396d
This commit is contained in:
committed by
Facebook Github Bot
parent
b16c22a8f3
commit
55fc795686
@@ -46,6 +46,9 @@
|
||||
- (void)css_setMaxWidth:(CGFloat)maxWidth;
|
||||
- (void)css_setMaxHeight:(CGFloat)maxHeight;
|
||||
|
||||
// Yoga specific properties, not compatible with flexbox specification
|
||||
- (void)css_setAspectRatio:(CGFloat)aspectRatio;
|
||||
|
||||
/**
|
||||
Get the resolved direction of this node. This won't be CSSDirectionInherit
|
||||
*/
|
||||
|
@@ -165,6 +165,11 @@
|
||||
CSSNodeStyleSetMaxHeight([self cssNode], maxHeight);
|
||||
}
|
||||
|
||||
- (void)css_setAspectRatio:(CGFloat)aspectRatio
|
||||
{
|
||||
CSSNodeStyleSetAspectRatio([self cssNode], aspectRatio);
|
||||
}
|
||||
|
||||
#pragma mark - Layout and Sizing
|
||||
|
||||
- (CSSDirection)css_resolvedDirection
|
||||
|
Reference in New Issue
Block a user