mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-09 22:43:10 +08:00
Rename YGUnitPixel to YGPoint...
Summary: ...to reflect the modern world we live in with dynamic DPI platforms :) Closes https://github.com/facebook/yoga/pull/375 Reviewed By: dshahidehpour Differential Revision: D4528518 Pulled By: emilsjolander fbshipit-source-id: e422bd4ae148e02c598a7b484a6adfa8c0e1e0c9
This commit is contained in:
committed by
Facebook Github Bot
parent
dbaa687518
commit
67f6b32409
@@ -107,7 +107,7 @@ import com.facebook.yoga.YogaUnit;
|
||||
@Override
|
||||
public void setPadding(int spacingType, float padding) {
|
||||
YogaValue current = getStylePadding(spacingType);
|
||||
if (current.unit != YogaUnit.PIXEL || current.value != padding) {
|
||||
if (current.unit != YogaUnit.POINT || current.value != padding) {
|
||||
super.setPadding(spacingType, padding);
|
||||
mPaddingChanged = true;
|
||||
markUpdated();
|
||||
|
||||
@@ -89,7 +89,7 @@ class FlatReactModalShadowNode extends FlatShadowNode implements AndroidView {
|
||||
@Override
|
||||
public void setPadding(int spacingType, float padding) {
|
||||
YogaValue current = getStylePadding(spacingType);
|
||||
if (current.unit != YogaUnit.PIXEL || current.value != padding) {
|
||||
if (current.unit != YogaUnit.POINT || current.value != padding) {
|
||||
super.setPadding(spacingType, padding);
|
||||
mPaddingChanged = true;
|
||||
markUpdated();
|
||||
|
||||
@@ -104,7 +104,7 @@ import com.facebook.yoga.YogaUnit;
|
||||
@Override
|
||||
public void setPadding(int spacingType, float padding) {
|
||||
YogaValue current = getStylePadding(spacingType);
|
||||
if (current.unit != YogaUnit.PIXEL || current.value != padding) {
|
||||
if (current.unit != YogaUnit.POINT || current.value != padding) {
|
||||
super.setPadding(spacingType, padding);
|
||||
mPaddingChanged = true;
|
||||
markUpdated();
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.facebook.proguard.annotations.DoNotStrip;
|
||||
@DoNotStrip
|
||||
public interface YogaBaselineFunction {
|
||||
/**
|
||||
* Return the baseline of the node in pixels. When no baseline function is set the baseline
|
||||
* Return the baseline of the node in points. When no baseline function is set the baseline
|
||||
* default to the computed height of the node.
|
||||
*/
|
||||
@DoNotStrip
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.facebook.proguard.annotations.DoNotStrip;
|
||||
@DoNotStrip
|
||||
public enum YogaUnit {
|
||||
UNDEFINED(0),
|
||||
PIXEL(1),
|
||||
POINT(1),
|
||||
PERCENT(2),
|
||||
AUTO(3);
|
||||
|
||||
@@ -31,7 +31,7 @@ public enum YogaUnit {
|
||||
public static YogaUnit fromInt(int value) {
|
||||
switch (value) {
|
||||
case 0: return UNDEFINED;
|
||||
case 1: return PIXEL;
|
||||
case 1: return POINT;
|
||||
case 2: return PERCENT;
|
||||
case 3: return AUTO;
|
||||
default: throw new IllegalArgumentException("Unknown enum value: " + value);
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.facebook.proguard.annotations.DoNotStrip;
|
||||
@DoNotStrip
|
||||
public class YogaValue {
|
||||
static final YogaValue UNDEFINED = new YogaValue(YogaConstants.UNDEFINED, YogaUnit.UNDEFINED);
|
||||
static final YogaValue ZERO = new YogaValue(0, YogaUnit.PIXEL);
|
||||
static final YogaValue ZERO = new YogaValue(0, YogaUnit.POINT);
|
||||
|
||||
public final float value;
|
||||
public final YogaUnit unit;
|
||||
|
||||
Reference in New Issue
Block a user