mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
paddings should be taken from style because they could be undefined from newValue (#2433)
This commit is contained in:
@ -640,11 +640,12 @@ export class ViewStyler implements style.Styler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static setPaddingProperty(view: View, newValue: Thickness) {
|
private static setPaddingProperty(view: View, newValue: Thickness) {
|
||||||
var density = utils.layout.getDisplayDensity();
|
let density = utils.layout.getDisplayDensity();
|
||||||
var left = Math.round((newValue.left + view.borderWidth) * density);
|
let style = view.style;
|
||||||
var top = Math.round((newValue.top + view.borderWidth) * density);
|
let left = Math.round((style.paddingLeft + view.borderWidth) * density);
|
||||||
var right = Math.round((newValue.right + view.borderWidth) * density);
|
let top = Math.round((style.paddingTop + view.borderWidth) * density);
|
||||||
var bottom = Math.round((newValue.bottom + view.borderWidth) * density);
|
let right = Math.round((style.paddingRight + view.borderWidth) * density);
|
||||||
|
let bottom = Math.round((style.paddingBottom + view.borderWidth) * density);
|
||||||
(<android.view.View>view._nativeView).setPadding(left, top, right, bottom);
|
(<android.view.View>view._nativeView).setPadding(left, top, right, bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user