From 0df909dd71198c0bc2cd341711c1120e94e2bfe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 19 Jun 2011 22:21:14 +0100 Subject: [PATCH] Rename ChangeFlags -> ChangeFlag. --- src/item/{ChangeFlags.js => ChangeFlag.js} | 14 +++++++------- src/item/Item.js | 8 ++++---- src/load.js | 2 +- src/paper.js | 2 +- src/path/Path.js | 4 ++-- src/project/Project.js | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) rename src/item/{ChangeFlags.js => ChangeFlag.js} (69%) diff --git a/src/item/ChangeFlags.js b/src/item/ChangeFlag.js similarity index 69% rename from src/item/ChangeFlags.js rename to src/item/ChangeFlag.js index 1a20abbe..f6e1c0ff 100644 --- a/src/item/ChangeFlags.js +++ b/src/item/ChangeFlag.js @@ -14,7 +14,7 @@ * All rights reserved. */ -var ChangeFlags = { +var ChangeFlag = { // Anything affecting the appearance of an item, including GEOMETRY, // STROKE, STYLE and ATTRIBUTE (except for the invisible ones: locked, name) APPEARANCE: 1, @@ -30,11 +30,11 @@ var ChangeFlags = { ATTRIBUTE: 32 }; -// Shortcuts to the ChangeFlags to send to #_changed(), all including appearance +// Shortcuts to the ChangeFlag to send to #_changed(), all including appearance var Change = { - HIERARCHY: ChangeFlags.HIERARCHY | ChangeFlags.APPEARANCE, - GEOMETRY: ChangeFlags.GEOMETRY | ChangeFlags.APPEARANCE, - STROKE: ChangeFlags.STROKE | ChangeFlags.APPEARANCE, - STYLE: ChangeFlags.STYLE | ChangeFlags.APPEARANCE, - ATTRIBUTE: ChangeFlags.ATTRIBUTE | ChangeFlags.APPEARANCE + HIERARCHY: ChangeFlag.HIERARCHY | ChangeFlag.APPEARANCE, + GEOMETRY: ChangeFlag.GEOMETRY | ChangeFlag.APPEARANCE, + STROKE: ChangeFlag.STROKE | ChangeFlag.APPEARANCE, + STYLE: ChangeFlag.STYLE | ChangeFlag.APPEARANCE, + ATTRIBUTE: ChangeFlag.ATTRIBUTE | ChangeFlag.APPEARANCE }; diff --git a/src/item/Item.js b/src/item/Item.js index a1585c56..21ae1942 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -39,10 +39,10 @@ var Item = this.Item = Base.extend({ * Private notifier that is called whenever a change occurs in this item or * its sub-elements, such as Segments, Curves, PathStyles, etc. * - * @param {ChangeFlags} flags describes what exactly has changed. + * @param {ChangeFlag} flags describes what exactly has changed. */ _changed: function(flags) { - if (flags & ChangeFlags.GEOMETRY) { + if (flags & ChangeFlag.GEOMETRY) { delete this._bounds; delete this._position; } @@ -99,7 +99,7 @@ var Item = this.Item = Base.extend({ (namedChildren[name] = namedChildren[name] || []).push(this); children[name] = this; } - this._changed(ChangeFlags.ATTRIBUTE); + this._changed(ChangeFlag.ATTRIBUTE); }, /** @@ -210,7 +210,7 @@ var Item = this.Item = Base.extend({ this[name] = value; // #locked does not change appearance, all others do: this._changed(name === '_locked' - ? ChangeFlags.ATTRIBUTE : Change.ATTRIBUTE); + ? ChangeFlag.ATTRIBUTE : Change.ATTRIBUTE); } }; }, {}); diff --git a/src/load.js b/src/load.js index 6f64f19f..eba11721 100644 --- a/src/load.js +++ b/src/load.js @@ -38,7 +38,7 @@ var sources = [ 'src/project/Project.js', 'src/project/Symbol.js', - 'src/item/ChangeFlags.js', + 'src/item/ChangeFlag.js', 'src/item/Item.js', 'src/item/Group.js', 'src/item/Layer.js', diff --git a/src/paper.js b/src/paper.js index 6fc251a8..045cffa4 100644 --- a/src/paper.js +++ b/src/paper.js @@ -58,7 +58,7 @@ var paper = new function() { //#include "project/Project.js" //#include "project/Symbol.js" -//#include "item/ChangeFlags.js" +//#include "item/ChangeFlag.js" //#include "item/Item.js" //#include "item/Group.js" //#include "item/Layer.js" diff --git a/src/path/Path.js b/src/path/Path.js index f5591c5c..b36ab8d4 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -60,14 +60,14 @@ var Path = this.Path = PathItem.extend({ }, _changed: function(flags) { - if (flags & ChangeFlags.GEOMETRY) { + if (flags & ChangeFlag.GEOMETRY) { delete this._bounds; delete this._position; delete this._strokeBounds; delete this._length; // Clockwise state becomes undefined as soon as geometry changes. delete this._clockwise; - } else if (flags & ChangeFlags.STROKE) { + } else if (flags & ChangeFlag.STROKE) { delete this._strokeBounds; } }, diff --git a/src/project/Project.js b/src/project/Project.js index d9ad2f17..1b158a2d 100644 --- a/src/project/Project.js +++ b/src/project/Project.js @@ -58,7 +58,7 @@ var Project = this.Project = Base.extend({ }, _changed: function(flags) { - if (flags & ChangeFlags.GEOMETRY) { + if (flags & ChangeFlag.GEOMETRY) { // TODO: Mark as requireRedraw } },