From 96ebd92bf5bb38de504be8e4d94a51b2a5967de3 Mon Sep 17 00:00:00 2001 From: David Aurelio Date: Fri, 22 Nov 2013 15:22:07 +0100 Subject: [PATCH] Prevent special paths from being constantly redrawn Yikes! --- src/runner/path/special_attr_path.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/runner/path/special_attr_path.js b/src/runner/path/special_attr_path.js index 307a94c9..f2dff6af 100644 --- a/src/runner/path/special_attr_path.js +++ b/src/runner/path/special_attr_path.js @@ -1,4 +1,5 @@ define(['./path', '../../tools'], function(Path, tools) { + var hasOwnProperty = Object.prototype.hasOwnProperty; function makeAccessor(attrName, defaultValue) { var value = defaultValue; @@ -36,6 +37,7 @@ define(['./path', '../../tools'], function(Path, tools) { Path.call(this); this._isProcessingPathAttribute = false; + this._specialNames = Object.keys(specialAttributes); for (var attrName in specialAttributes) { Object.defineProperty( @@ -67,8 +69,10 @@ define(['./path', '../../tools'], function(Path, tools) { // going through the entire map of attributes: this._isProcessingPathAttribute = true; attrMethod.call(this, attr); - this.clear(); - this._make(); + if (this._specialNames.some(hasOwnProperty, this._mutatedAttributes)) { + this.clear(); + this._make(); + } this._isProcessingPathAttribute = false; return this; }