Padding is not reset if the elements has a border-related property set

This commit is contained in:
Maya Zhecheva
2016-09-14 17:17:00 +03:00
parent b174762a48
commit 51bfa93879

View File

@@ -101,11 +101,16 @@ export module ad {
} }
} }
let leftPadding = v.style.paddingLeft ? v.style.paddingLeft : nativeView.getPaddingLeft() / density;
let topPadding = v.style.paddingTop ? v.style.paddingTop : nativeView.getPaddingTop() / density;
let rightPadding = v.style.paddingRight ? v.style.paddingRight : nativeView.getPaddingRight() / density;
let bottomPadding = v.style.paddingBottom ? v.style.paddingBottom : nativeView.getPaddingBottom() / density;
nativeView.setPadding( nativeView.setPadding(
Math.round((background.borderWidth + v.style.paddingLeft) * density), Math.round((background.borderWidth + leftPadding) * density),
Math.round((background.borderWidth + v.style.paddingTop) * density), Math.round((background.borderWidth + topPadding) * density),
Math.round((background.borderWidth + v.style.paddingRight) * density), Math.round((background.borderWidth + rightPadding) * density),
Math.round((background.borderWidth + v.style.paddingBottom) * density) Math.round((background.borderWidth + bottomPadding) * density)
); );
} }
} }