Loading tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeTypedArray.java +4 −11 Original line number Original line Diff line number Diff line Loading @@ -491,18 +491,11 @@ public final class BridgeTypedArray extends TypedArray { if (ResourceHelper.stringToFloat(s, mValue)) { if (ResourceHelper.stringToFloat(s, mValue)) { float f = mValue.getDimension(mBridgeResources.mMetrics); float f = mValue.getDimension(mBridgeResources.mMetrics); if (f < 0) { final int res = (int)(f+0.5f); // negative values are not allowed in pixel dimensions if (res != 0) return res; Bridge.getLog().error(LayoutLog.TAG_BROKEN, "Negative pixel dimension: " + s, null, null /*data*/); return defValue; } if (f == 0) return 0; if (f == 0) return 0; if (f < 1) return 1; if (f > 0) return 1; return defValue; // this is basically unreachable. return (int)(f+0.5f); } } // looks like we were unable to resolve the dimension value // looks like we were unable to resolve the dimension value Loading Loading
tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeTypedArray.java +4 −11 Original line number Original line Diff line number Diff line Loading @@ -491,18 +491,11 @@ public final class BridgeTypedArray extends TypedArray { if (ResourceHelper.stringToFloat(s, mValue)) { if (ResourceHelper.stringToFloat(s, mValue)) { float f = mValue.getDimension(mBridgeResources.mMetrics); float f = mValue.getDimension(mBridgeResources.mMetrics); if (f < 0) { final int res = (int)(f+0.5f); // negative values are not allowed in pixel dimensions if (res != 0) return res; Bridge.getLog().error(LayoutLog.TAG_BROKEN, "Negative pixel dimension: " + s, null, null /*data*/); return defValue; } if (f == 0) return 0; if (f == 0) return 0; if (f < 1) return 1; if (f > 0) return 1; return defValue; // this is basically unreachable. return (int)(f+0.5f); } } // looks like we were unable to resolve the dimension value // looks like we were unable to resolve the dimension value Loading