CKFlexboxComponent live editing
Summary: CKFlexboxComponent's insets are now live editable P.S. Now it takes some time to see the view changed and the new value of everything on flipper side Reviewed By: kevin0571 Differential Revision: D16379743 fbshipit-source-id: 69bc9b7cb6b2103ff34b5c4489b240ac7562a85d
This commit is contained in:
committed by
Facebook Github Bot
parent
f42badeb88
commit
b697d147d1
@@ -20,6 +20,16 @@ NSString *relativeDimension(CKRelativeDimension dimension) {
|
||||
}
|
||||
}
|
||||
|
||||
CKRelativeDimension relativeStructDimension(NSString *dimension) {
|
||||
if ([dimension hasSuffix:@"%"]) {
|
||||
return CKRelativeDimension::Percent([[dimension substringToIndex:([dimension length] - 1)] integerValue]);
|
||||
}
|
||||
if ([dimension hasSuffix:@"pt"]) {
|
||||
return CKRelativeDimension::Points([[dimension substringToIndex:([dimension length] - 2)] integerValue]);
|
||||
}
|
||||
return CKRelativeDimension::Auto();
|
||||
}
|
||||
|
||||
NSDictionary<NSString *, NSString *> *flexboxRect(CKFlexboxSpacing spacing) {
|
||||
return @{
|
||||
@"top": relativeDimension(spacing.top.dimension()),
|
||||
|
||||
Reference in New Issue
Block a user