mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Setting inline style - resets local properties
This commit is contained in:
@@ -761,7 +761,13 @@ export class View extends proxy.ProxyObject implements definition.View {
|
||||
|
||||
private _applyInlineStyle(inlineStyle) {
|
||||
if (types.isString(inlineStyle)) {
|
||||
styleScope.applyInlineSyle(this, <string>inlineStyle);
|
||||
try {
|
||||
this.style._beginUpdate();
|
||||
this.style._resetLocalValues();
|
||||
styleScope.applyInlineSyle(this, <string>inlineStyle);
|
||||
} finally {
|
||||
this.style._endUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -79,8 +79,6 @@ export module ad {
|
||||
var boundsHeight = bounds.height();
|
||||
|
||||
if (this.background && !this.background.isEmpty() && boundsWidth > 0 && boundsHeight > 0) {
|
||||
var bitmap = this.background.image.android;
|
||||
|
||||
var radius = this._cornerRadius * this._density;
|
||||
var stroke = this._borderWidth * this._density;
|
||||
var bounds = this.getBounds();
|
||||
@@ -96,7 +94,8 @@ export module ad {
|
||||
}
|
||||
|
||||
if (this.background.image) {
|
||||
var params = this.background.getDrawParams(boundsWidth, boundsHeight);
|
||||
let bitmap = this.background.image.android;
|
||||
let params = this.background.getDrawParams(boundsWidth, boundsHeight);
|
||||
|
||||
var matrix = new android.graphics.Matrix();
|
||||
if (params.sizeX > 0 && params.sizeY > 0) {
|
||||
|
||||
@@ -282,6 +282,14 @@ export class Style extends observable.DependencyObservable implements styling.St
|
||||
});
|
||||
}
|
||||
|
||||
public _resetLocalValues() {
|
||||
var that = this;
|
||||
this._eachSetProperty(function (property: observable.Property) {
|
||||
that._resetValue(property, observable.ValueSource.Local);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
public _onPropertyChanged(property: dependencyObservable.Property, oldValue: any, newValue: any) {
|
||||
trace.write(
|
||||
"Style._onPropertyChanged view:" + this._view +
|
||||
|
||||
Reference in New Issue
Block a user