mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00
Merge pull request #965 from NativeScript/feature/perf-optimizations
Don't apply default values on syncNative
This commit is contained in:
@ -249,6 +249,10 @@ export class View extends viewCommon.View {
|
|||||||
trace.write("calling _onContextChanged on view " + this._domId, trace.categories.VisualTreeEvents);
|
trace.write("calling _onContextChanged on view " + this._domId, trace.categories.VisualTreeEvents);
|
||||||
|
|
||||||
this._createUI();
|
this._createUI();
|
||||||
|
// Ensure layout params
|
||||||
|
if (this._nativeView && !(this._nativeView.getLayoutParams() instanceof org.nativescript.widgets.CommonLayoutParams)) {
|
||||||
|
this._nativeView.setLayoutParams(new org.nativescript.widgets.CommonLayoutParams());
|
||||||
|
}
|
||||||
|
|
||||||
utils.copyFrom(this._options, this);
|
utils.copyFrom(this._options, this);
|
||||||
delete this._options;
|
delete this._options;
|
||||||
|
@ -593,7 +593,8 @@ export class Style extends DependencyObservable implements styling.Style {
|
|||||||
// TODO: Potential performance bottle-neck
|
// TODO: Potential performance bottle-neck
|
||||||
styleProperty.eachProperty(function (p: styleProperty.Property) {
|
styleProperty.eachProperty(function (p: styleProperty.Property) {
|
||||||
var value = that._getValue(p);
|
var value = that._getValue(p);
|
||||||
if (types.isDefined(value)) {
|
var valueSource = that._getValueSource(p);
|
||||||
|
if (valueSource !== ValueSource.Default && types.isDefined(value)) {
|
||||||
that._applyProperty(p, value);
|
that._applyProperty(p, value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user