Add min/max in YogaRecord
Summary: Add min/max in YogaRecord Reviewed By: emilsjolander Differential Revision: D6998533 fbshipit-source-id: 4613c99bd3a4cb3b8fbe577909157b25f3bef9c7
This commit is contained in:
committed by
Facebook Github Bot
parent
1b66b5d941
commit
69242938f7
@@ -21,7 +21,7 @@ import type {
|
|||||||
Yoga$JustifyContent,
|
Yoga$JustifyContent,
|
||||||
Yoga$FlexDirection,
|
Yoga$FlexDirection,
|
||||||
Yoga$FlexWrap,
|
Yoga$FlexWrap,
|
||||||
Yoga$PositionType,
|
Yoga$YogaPositionType,
|
||||||
} from 'yoga-layout';
|
} from 'yoga-layout';
|
||||||
|
|
||||||
export type LayoutRecordT = RecordOf<{
|
export type LayoutRecordT = RecordOf<{
|
||||||
@@ -32,7 +32,7 @@ export type LayoutRecordT = RecordOf<{
|
|||||||
border: PositionRecordT,
|
border: PositionRecordT,
|
||||||
margin: PositionRecordT,
|
margin: PositionRecordT,
|
||||||
position: PositionRecordT,
|
position: PositionRecordT,
|
||||||
positionType: Yoga$PositionType,
|
positionType: Yoga$YogaPositionType,
|
||||||
alignItems?: Yoga$Align,
|
alignItems?: Yoga$Align,
|
||||||
alignSelf?: Yoga$Align,
|
alignSelf?: Yoga$Align,
|
||||||
alignContent?: Yoga$Align,
|
alignContent?: Yoga$Align,
|
||||||
@@ -44,6 +44,10 @@ export type LayoutRecordT = RecordOf<{
|
|||||||
flexWrap?: Yoga$FlexWrap,
|
flexWrap?: Yoga$FlexWrap,
|
||||||
aspectRatio?: number,
|
aspectRatio?: number,
|
||||||
children?: List<LayoutRecordT>,
|
children?: List<LayoutRecordT>,
|
||||||
|
minWidth?: number,
|
||||||
|
maxWidth?: number,
|
||||||
|
minHeight?: number,
|
||||||
|
maxHeight?: number,
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
const r: LayoutRecordT = Record({
|
const r: LayoutRecordT = Record({
|
||||||
@@ -65,6 +69,10 @@ const r: LayoutRecordT = Record({
|
|||||||
flexShrink: 1,
|
flexShrink: 1,
|
||||||
children: List(),
|
children: List(),
|
||||||
aspectRatio: 'auto',
|
aspectRatio: 'auto',
|
||||||
|
minWidth: undefined,
|
||||||
|
maxWidth: undefined,
|
||||||
|
minHeight: undefined,
|
||||||
|
maxHeight: undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
export default r;
|
export default r;
|
||||||
|
@@ -107,6 +107,10 @@ export default class YogaNode extends Component<Props, State> {
|
|||||||
const root = Node.create();
|
const root = Node.create();
|
||||||
root.setWidth(layoutDefinition.width);
|
root.setWidth(layoutDefinition.width);
|
||||||
root.setHeight(layoutDefinition.height);
|
root.setHeight(layoutDefinition.height);
|
||||||
|
root.setMinWidth(layoutDefinition.minWidth);
|
||||||
|
root.setMaxWidth(layoutDefinition.maxWidth);
|
||||||
|
root.setMinHeight(layoutDefinition.minHeight);
|
||||||
|
root.setMaxHeight(layoutDefinition.maxHeight);
|
||||||
root.setJustifyContent(layoutDefinition.justifyContent);
|
root.setJustifyContent(layoutDefinition.justifyContent);
|
||||||
root.setAlignItems(layoutDefinition.alignItems);
|
root.setAlignItems(layoutDefinition.alignItems);
|
||||||
root.setAlignSelf(layoutDefinition.alignSelf);
|
root.setAlignSelf(layoutDefinition.alignSelf);
|
||||||
|
Reference in New Issue
Block a user