Some minor code and comment cleanup.

This commit is contained in:
Jürg Lehni 2016-03-28 07:59:55 -07:00
parent e054b760ed
commit fc03e042f9
2 changed files with 6 additions and 4 deletions

View file

@ -809,7 +809,7 @@ var Point = Base.extend(/** @lends Point# */{
* path.segments[2].point.selected = true; * path.segments[2].point.selected = true;
* *
* // Select the item's position, which is the pivot point * // Select the item's position, which is the pivot point
* // around which it is trasnformed: * // around which it is transformed:
* path.position.selected = true; * path.position.selected = true;
*/ */

View file

@ -176,6 +176,8 @@ new function() { // Injection scope for various item event handlers
function serialize(fields) { function serialize(fields) {
for (var key in fields) { for (var key in fields) {
// value is the default value, only serialize if the current
// value is different from it.
var value = that[key]; var value = that[key];
// Style#leading is a special case, as its default value is // Style#leading is a special case, as its default value is
// dependent on the fontSize. Handle this here separately. // dependent on the fontSize. Handle this here separately.
@ -2349,7 +2351,7 @@ new function() { // Injection scope for hit-test functions shared with project
items.splice(i, 1); items.splice(i, 1);
} else { } else {
// If the item is removed and inserted it again further // If the item is removed and inserted it again further
/// above, the index needs to be adjusted accordingly. // above, the index needs to be adjusted accordingly.
var owner = item._getOwner(), var owner = item._getOwner(),
shift = owner === this && item._index < index; shift = owner === this && item._index < index;
// Notify parent of change. Don't notify item itself yet, // Notify parent of change. Don't notify item itself yet,
@ -2361,12 +2363,12 @@ new function() { // Injection scope for hit-test functions shared with project
Base.splice(children, items, index, 0); Base.splice(children, items, index, 0);
var project = this._project, var project = this._project,
// See #_remove() for an explanation of this: // See #_remove() for an explanation of this:
notifySelf = project && project._changes; notifySelf = project._changes;
for (var i = 0, l = items.length; i < l; i++) { for (var i = 0, l = items.length; i < l; i++) {
var item = items[i], var item = items[i],
name = item._name; name = item._name;
item._parent = this; item._parent = this;
item._setProject(this._project, true); item._setProject(project, true);
// Set the name again to make sure all name lookup structures // Set the name again to make sure all name lookup structures
// are kept in sync. // are kept in sync.
if (name) if (name)