s/CGFloat/float in RCTShadowView

Reviewed By: emilsjolander

Differential Revision: D4081788

fbshipit-source-id: 91da6af0fff1317ff4661572e8e7c1cc5594f810
This commit is contained in:
Pieter De Baets 2016-10-26 13:12:26 -07:00 committed by Facebook Github Bot
parent 4ea359a4f3
commit 82911a8204
3 changed files with 82 additions and 81 deletions

View File

@ -72,18 +72,18 @@ typedef void (^RCTApplierBlock)(NSDictionary<NSNumber *, UIView *> *viewRegistry
* Position and dimensions. * Position and dimensions.
* Defaults to { 0, 0, NAN, NAN }. * Defaults to { 0, 0, NAN, NAN }.
*/ */
@property (nonatomic, assign) CGFloat top; @property (nonatomic, assign) float top;
@property (nonatomic, assign) CGFloat left; @property (nonatomic, assign) float left;
@property (nonatomic, assign) CGFloat bottom; @property (nonatomic, assign) float bottom;
@property (nonatomic, assign) CGFloat right; @property (nonatomic, assign) float right;
@property (nonatomic, assign) CGFloat width; @property (nonatomic, assign) float width;
@property (nonatomic, assign) CGFloat height; @property (nonatomic, assign) float height;
@property (nonatomic, assign) CGFloat minWidth; @property (nonatomic, assign) float minWidth;
@property (nonatomic, assign) CGFloat maxWidth; @property (nonatomic, assign) float maxWidth;
@property (nonatomic, assign) CGFloat minHeight; @property (nonatomic, assign) float minHeight;
@property (nonatomic, assign) CGFloat maxHeight; @property (nonatomic, assign) float maxHeight;
@property (nonatomic, assign) CGRect frame; @property (nonatomic, assign) CGRect frame;
@ -99,33 +99,33 @@ typedef void (^RCTApplierBlock)(NSDictionary<NSNumber *, UIView *> *viewRegistry
/** /**
* Border. Defaults to { 0, 0, 0, 0 }. * Border. Defaults to { 0, 0, 0, 0 }.
*/ */
@property (nonatomic, assign) CGFloat borderWidth; @property (nonatomic, assign) float borderWidth;
@property (nonatomic, assign) CGFloat borderTopWidth; @property (nonatomic, assign) float borderTopWidth;
@property (nonatomic, assign) CGFloat borderLeftWidth; @property (nonatomic, assign) float borderLeftWidth;
@property (nonatomic, assign) CGFloat borderBottomWidth; @property (nonatomic, assign) float borderBottomWidth;
@property (nonatomic, assign) CGFloat borderRightWidth; @property (nonatomic, assign) float borderRightWidth;
/** /**
* Margin. Defaults to { 0, 0, 0, 0 }. * Margin. Defaults to { 0, 0, 0, 0 }.
*/ */
@property (nonatomic, assign) CGFloat margin; @property (nonatomic, assign) float margin;
@property (nonatomic, assign) CGFloat marginVertical; @property (nonatomic, assign) float marginVertical;
@property (nonatomic, assign) CGFloat marginHorizontal; @property (nonatomic, assign) float marginHorizontal;
@property (nonatomic, assign) CGFloat marginTop; @property (nonatomic, assign) float marginTop;
@property (nonatomic, assign) CGFloat marginLeft; @property (nonatomic, assign) float marginLeft;
@property (nonatomic, assign) CGFloat marginBottom; @property (nonatomic, assign) float marginBottom;
@property (nonatomic, assign) CGFloat marginRight; @property (nonatomic, assign) float marginRight;
/** /**
* Padding. Defaults to { 0, 0, 0, 0 }. * Padding. Defaults to { 0, 0, 0, 0 }.
*/ */
@property (nonatomic, assign) CGFloat padding; @property (nonatomic, assign) float padding;
@property (nonatomic, assign) CGFloat paddingVertical; @property (nonatomic, assign) float paddingVertical;
@property (nonatomic, assign) CGFloat paddingHorizontal; @property (nonatomic, assign) float paddingHorizontal;
@property (nonatomic, assign) CGFloat paddingTop; @property (nonatomic, assign) float paddingTop;
@property (nonatomic, assign) CGFloat paddingLeft; @property (nonatomic, assign) float paddingLeft;
@property (nonatomic, assign) CGFloat paddingBottom; @property (nonatomic, assign) float paddingBottom;
@property (nonatomic, assign) CGFloat paddingRight; @property (nonatomic, assign) float paddingRight;
- (UIEdgeInsets)paddingAsInsets; - (UIEdgeInsets)paddingAsInsets;
@ -138,9 +138,10 @@ typedef void (^RCTApplierBlock)(NSDictionary<NSNumber *, UIView *> *viewRegistry
@property (nonatomic, assign) CSSAlign alignItems; @property (nonatomic, assign) CSSAlign alignItems;
@property (nonatomic, assign) CSSPositionType position; @property (nonatomic, assign) CSSPositionType position;
@property (nonatomic, assign) CSSWrapType flexWrap; @property (nonatomic, assign) CSSWrapType flexWrap;
@property (nonatomic, assign) CGFloat flexGrow;
@property (nonatomic, assign) CGFloat flexShrink; @property (nonatomic, assign) float flexGrow;
@property (nonatomic, assign) CGFloat flexBasis; @property (nonatomic, assign) float flexShrink;
@property (nonatomic, assign) float flexBasis;
- (void)setFlex:(float)flex; - (void)setFlex:(float)flex;

View File

@ -440,12 +440,12 @@ DEFINE_PROCESS_META_PROPS(Border);
// Margin // Margin
#define RCT_MARGIN_PROPERTY(prop, metaProp) \ #define RCT_MARGIN_PROPERTY(prop, metaProp) \
- (void)setMargin##prop:(CGFloat)value \ - (void)setMargin##prop:(float)value \
{ \ { \
_marginMetaProps[META_PROP_##metaProp] = value; \ _marginMetaProps[META_PROP_##metaProp] = value; \
_recomputeMargin = YES; \ _recomputeMargin = YES; \
} \ } \
- (CGFloat)margin##prop \ - (float)margin##prop \
{ \ { \
return _marginMetaProps[META_PROP_##metaProp]; \ return _marginMetaProps[META_PROP_##metaProp]; \
} }
@ -461,12 +461,12 @@ RCT_MARGIN_PROPERTY(Right, RIGHT)
// Padding // Padding
#define RCT_PADDING_PROPERTY(prop, metaProp) \ #define RCT_PADDING_PROPERTY(prop, metaProp) \
- (void)setPadding##prop:(CGFloat)value \ - (void)setPadding##prop:(float)value \
{ \ { \
_paddingMetaProps[META_PROP_##metaProp] = value; \ _paddingMetaProps[META_PROP_##metaProp] = value; \
_recomputePadding = YES; \ _recomputePadding = YES; \
} \ } \
- (CGFloat)padding##prop \ - (float)padding##prop \
{ \ { \
return _paddingMetaProps[META_PROP_##metaProp]; \ return _paddingMetaProps[META_PROP_##metaProp]; \
} }
@ -509,12 +509,12 @@ RCT_PADDING_PROPERTY(Right, RIGHT)
// Border // Border
#define RCT_BORDER_PROPERTY(prop, metaProp) \ #define RCT_BORDER_PROPERTY(prop, metaProp) \
- (void)setBorder##prop##Width:(CGFloat)value \ - (void)setBorder##prop##Width:(float)value \
{ \ { \
_borderMetaProps[META_PROP_##metaProp] = value; \ _borderMetaProps[META_PROP_##metaProp] = value; \
_recomputeBorder = YES; \ _recomputeBorder = YES; \
} \ } \
- (CGFloat)border##prop##Width \ - (float)border##prop##Width \
{ \ { \
return _borderMetaProps[META_PROP_##metaProp]; \ return _borderMetaProps[META_PROP_##metaProp]; \
} }
@ -529,12 +529,12 @@ RCT_BORDER_PROPERTY(Right, RIGHT)
#define RCT_DIMENSION_PROPERTY(setProp, getProp, cssProp) \ #define RCT_DIMENSION_PROPERTY(setProp, getProp, cssProp) \
- (void)set##setProp:(CGFloat)value \ - (void)set##setProp:(float)value \
{ \ { \
CSSNodeStyleSet##cssProp(_cssNode, value); \ CSSNodeStyleSet##cssProp(_cssNode, value); \
[self dirtyText]; \ [self dirtyText]; \
} \ } \
- (CGFloat)getProp \ - (float)getProp \
{ \ { \
return CSSNodeStyleGet##cssProp(_cssNode); \ return CSSNodeStyleGet##cssProp(_cssNode); \
} }
@ -549,12 +549,12 @@ RCT_DIMENSION_PROPERTY(MaxHeight, maxHeight, MaxHeight)
// Position // Position
#define RCT_POSITION_PROPERTY(setProp, getProp, edge) \ #define RCT_POSITION_PROPERTY(setProp, getProp, edge) \
- (void)set##setProp:(CGFloat)value \ - (void)set##setProp:(float)value \
{ \ { \
CSSNodeStyleSetPosition(_cssNode, edge, value); \ CSSNodeStyleSetPosition(_cssNode, edge, value); \
[self dirtyText]; \ [self dirtyText]; \
} \ } \
- (CGFloat)getProp \ - (float)getProp \
{ \ { \
return CSSNodeStyleGetPosition(_cssNode, edge); \ return CSSNodeStyleGetPosition(_cssNode, edge); \
} }
@ -630,9 +630,9 @@ static inline void RCTAssignSuggestedDimension(CSSNodeRef cssNode, CSSDimension
return CSSNodeStyleGet##cssProp(_cssNode); \ return CSSNodeStyleGet##cssProp(_cssNode); \
} }
RCT_STYLE_PROPERTY(FlexGrow, flexGrow, FlexGrow, CGFloat) RCT_STYLE_PROPERTY(FlexGrow, flexGrow, FlexGrow, float)
RCT_STYLE_PROPERTY(FlexShrink, flexShrink, FlexShrink, CGFloat) RCT_STYLE_PROPERTY(FlexShrink, flexShrink, FlexShrink, float)
RCT_STYLE_PROPERTY(FlexBasis, flexBasis, FlexBasis, CGFloat) RCT_STYLE_PROPERTY(FlexBasis, flexBasis, FlexBasis, float)
RCT_STYLE_PROPERTY(FlexDirection, flexDirection, FlexDirection, CSSFlexDirection) RCT_STYLE_PROPERTY(FlexDirection, flexDirection, FlexDirection, CSSFlexDirection)
RCT_STYLE_PROPERTY(JustifyContent, justifyContent, JustifyContent, CSSJustify) RCT_STYLE_PROPERTY(JustifyContent, justifyContent, JustifyContent, CSSJustify)
RCT_STYLE_PROPERTY(AlignSelf, alignSelf, AlignSelf, CSSAlign) RCT_STYLE_PROPERTY(AlignSelf, alignSelf, AlignSelf, CSSAlign)

View File

@ -193,7 +193,7 @@ RCT_CUSTOM_VIEW_PROPERTY(borderColor, CGColor, RCTView)
view.layer.borderColor = json ? [RCTConvert CGColor:json] : defaultView.layer.borderColor; view.layer.borderColor = json ? [RCTConvert CGColor:json] : defaultView.layer.borderColor;
} }
} }
RCT_CUSTOM_VIEW_PROPERTY(borderWidth, CGFloat, RCTView) RCT_CUSTOM_VIEW_PROPERTY(borderWidth, float, RCTView)
{ {
if ([view respondsToSelector:@selector(setBorderWidth:)]) { if ([view respondsToSelector:@selector(setBorderWidth:)]) {
view.borderWidth = json ? [RCTConvert CGFloat:json] : defaultView.borderWidth; view.borderWidth = json ? [RCTConvert CGFloat:json] : defaultView.borderWidth;
@ -222,10 +222,10 @@ RCT_EXPORT_VIEW_PROPERTY(onAccessibilityTap, RCTDirectEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onMagicTap, RCTDirectEventBlock) RCT_EXPORT_VIEW_PROPERTY(onMagicTap, RCTDirectEventBlock)
#define RCT_VIEW_BORDER_PROPERTY(SIDE) \ #define RCT_VIEW_BORDER_PROPERTY(SIDE) \
RCT_CUSTOM_VIEW_PROPERTY(border##SIDE##Width, CGFloat, RCTView) \ RCT_CUSTOM_VIEW_PROPERTY(border##SIDE##Width, float, RCTView) \
{ \ { \
if ([view respondsToSelector:@selector(setBorder##SIDE##Width:)]) { \ if ([view respondsToSelector:@selector(setBorder##SIDE##Width:)]) { \
view.border##SIDE##Width = json ? [RCTConvert CGFloat:json] : defaultView.border##SIDE##Width; \ view.border##SIDE##Width = json ? [RCTConvert float:json] : defaultView.border##SIDE##Width; \
} \ } \
} \ } \
RCT_CUSTOM_VIEW_PROPERTY(border##SIDE##Color, UIColor, RCTView) \ RCT_CUSTOM_VIEW_PROPERTY(border##SIDE##Color, UIColor, RCTView) \
@ -259,45 +259,45 @@ RCT_REMAP_VIEW_PROPERTY(zIndex, reactZIndex, NSInteger)
RCT_EXPORT_SHADOW_PROPERTY(backgroundColor, UIColor) RCT_EXPORT_SHADOW_PROPERTY(backgroundColor, UIColor)
RCT_EXPORT_SHADOW_PROPERTY(top, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(top, float)
RCT_EXPORT_SHADOW_PROPERTY(right, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(right, float)
RCT_EXPORT_SHADOW_PROPERTY(bottom, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(bottom, float)
RCT_EXPORT_SHADOW_PROPERTY(left, CGFloat); RCT_EXPORT_SHADOW_PROPERTY(left, float);
RCT_EXPORT_SHADOW_PROPERTY(width, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(width, float)
RCT_EXPORT_SHADOW_PROPERTY(height, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(height, float)
RCT_EXPORT_SHADOW_PROPERTY(minWidth, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(minWidth, float)
RCT_EXPORT_SHADOW_PROPERTY(maxWidth, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(maxWidth, float)
RCT_EXPORT_SHADOW_PROPERTY(minHeight, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(minHeight, float)
RCT_EXPORT_SHADOW_PROPERTY(maxHeight, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(maxHeight, float)
RCT_EXPORT_SHADOW_PROPERTY(borderTopWidth, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(borderTopWidth, float)
RCT_EXPORT_SHADOW_PROPERTY(borderRightWidth, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(borderRightWidth, float)
RCT_EXPORT_SHADOW_PROPERTY(borderBottomWidth, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(borderBottomWidth, float)
RCT_EXPORT_SHADOW_PROPERTY(borderLeftWidth, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(borderLeftWidth, float)
RCT_EXPORT_SHADOW_PROPERTY(borderWidth, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(borderWidth, float)
RCT_EXPORT_SHADOW_PROPERTY(marginTop, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(marginTop, float)
RCT_EXPORT_SHADOW_PROPERTY(marginRight, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(marginRight, float)
RCT_EXPORT_SHADOW_PROPERTY(marginBottom, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(marginBottom, float)
RCT_EXPORT_SHADOW_PROPERTY(marginLeft, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(marginLeft, float)
RCT_EXPORT_SHADOW_PROPERTY(marginVertical, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(marginVertical, float)
RCT_EXPORT_SHADOW_PROPERTY(marginHorizontal, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(marginHorizontal, float)
RCT_EXPORT_SHADOW_PROPERTY(margin, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(margin, float)
RCT_EXPORT_SHADOW_PROPERTY(paddingTop, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(paddingTop, float)
RCT_EXPORT_SHADOW_PROPERTY(paddingRight, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(paddingRight, float)
RCT_EXPORT_SHADOW_PROPERTY(paddingBottom, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(paddingBottom, float)
RCT_EXPORT_SHADOW_PROPERTY(paddingLeft, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(paddingLeft, float)
RCT_EXPORT_SHADOW_PROPERTY(paddingVertical, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(paddingVertical, float)
RCT_EXPORT_SHADOW_PROPERTY(paddingHorizontal, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(paddingHorizontal, float)
RCT_EXPORT_SHADOW_PROPERTY(padding, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(padding, float)
RCT_EXPORT_SHADOW_PROPERTY(flex, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(flex, float)
RCT_EXPORT_SHADOW_PROPERTY(flexGrow, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(flexGrow, float)
RCT_EXPORT_SHADOW_PROPERTY(flexShrink, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(flexShrink, float)
RCT_EXPORT_SHADOW_PROPERTY(flexBasis, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(flexBasis, float)
RCT_EXPORT_SHADOW_PROPERTY(flexDirection, CSSFlexDirection) RCT_EXPORT_SHADOW_PROPERTY(flexDirection, CSSFlexDirection)
RCT_EXPORT_SHADOW_PROPERTY(flexWrap, CSSWrapType) RCT_EXPORT_SHADOW_PROPERTY(flexWrap, CSSWrapType)
RCT_EXPORT_SHADOW_PROPERTY(justifyContent, CSSJustify) RCT_EXPORT_SHADOW_PROPERTY(justifyContent, CSSJustify)