Big refactor moving most logic into DebugComponent

Reviewed By: passy

Differential Revision: D5027780

fbshipit-source-id: 95a95b3572747aa2088f8f9b35a160257eb59269
This commit is contained in:
Emil Sjolander 2017-05-12 03:50:32 -07:00 committed by Facebook Github Bot
parent 562f6c55fa
commit 81b9e108bb

View File

@ -44,4 +44,20 @@ public class YogaValue {
public int hashCode() {
return Float.floatToIntBits(value) + unit.intValue();
}
@Override
public String toString() {
switch (unit) {
case UNDEFINED:
return "undefined";
case POINT:
return Float.toString(value);
case PERCENT:
return value + "%";
case AUTO:
return "auto";
default:
throw new IllegalStateException();
}
}
}