[YogaKit] fix complie error with ObjC++

This commit is contained in:
vvveiii
2020-08-14 14:07:40 +08:00
parent f7b77210bc
commit b5b42bd6c5

View File

@@ -149,11 +149,11 @@
lowercased_name, capitalized_name, capitalized_name, YGEdgeAll) lowercased_name, capitalized_name, capitalized_name, YGEdgeAll)
YGValue YGPointValue(CGFloat value) { YGValue YGPointValue(CGFloat value) {
return (YGValue){.value = value, .unit = YGUnitPoint}; return (YGValue){.value = (float)value, .unit = YGUnitPoint};
} }
YGValue YGPercentValue(CGFloat value) { YGValue YGPercentValue(CGFloat value) {
return (YGValue){.value = value, .unit = YGUnitPercent}; return (YGValue){.value = (float)value, .unit = YGUnitPercent};
} }
static CGFloat YGScaleFactor() { static CGFloat YGScaleFactor() {
@@ -407,9 +407,9 @@ static YGSize YGMeasureView(
} }
return (YGSize){ return (YGSize){
.width = YGSanitizeMeasurement( .width = (float)YGSanitizeMeasurement(
constrainedWidth, sizeThatFits.width, widthMode), constrainedWidth, sizeThatFits.width, widthMode),
.height = YGSanitizeMeasurement( .height = (float)YGSanitizeMeasurement(
constrainedHeight, sizeThatFits.height, heightMode), constrainedHeight, sizeThatFits.height, heightMode),
}; };
} }