Skip to content

Commit

Permalink
Prevent special paths from being constantly redrawn
Browse files Browse the repository at this point in the history
Yikes!
  • Loading branch information
David Aurelio committed Nov 25, 2013
1 parent 11104cd commit 96ebd92
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/runner/path/special_attr_path.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
define(['./path', '../../tools'], function(Path, tools) {
var hasOwnProperty = Object.prototype.hasOwnProperty;

function makeAccessor(attrName, defaultValue) {
var value = defaultValue;
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 96ebd92

Please sign in to comment.