2011-05-07 08:39:17 -04:00
|
|
|
/*
|
2013-01-28 21:03:27 -05:00
|
|
|
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
|
2011-05-07 08:39:17 -04:00
|
|
|
* http://paperjs.org/
|
2011-06-30 06:01:51 -04:00
|
|
|
*
|
2015-12-27 12:09:25 -05:00
|
|
|
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
|
2014-01-03 19:47:16 -05:00
|
|
|
* http://scratchdisk.com/ & http://jonathanpuckey.com/
|
2011-06-30 06:01:51 -04:00
|
|
|
*
|
2011-07-01 06:17:45 -04:00
|
|
|
* Distributed under the MIT license. See LICENSE file for details.
|
|
|
|
*
|
2011-05-07 08:39:17 -04:00
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
2011-06-19 17:21:14 -04:00
|
|
|
var ChangeFlag = {
|
2014-08-16 13:24:54 -04:00
|
|
|
// Anything affecting the appearance of an item, including GEOMETRY,
|
|
|
|
// STROKE, STYLE and ATTRIBUTE (except for the invisible ones: locked, name)
|
|
|
|
APPEARANCE: 0x1,
|
|
|
|
// A change in the item's children
|
|
|
|
CHILDREN: 0x2,
|
2015-12-28 15:26:42 -05:00
|
|
|
// A change of the item's place in the scene graph (removed, inserted,
|
|
|
|
// moved).
|
2014-08-16 13:24:54 -04:00
|
|
|
INSERTION: 0x4,
|
|
|
|
// Item geometry (path, bounds)
|
|
|
|
GEOMETRY: 0x8,
|
|
|
|
// Only segment(s) have changed, and affected curves have already been
|
|
|
|
// notified. This is to implement an optimization in _changed() calls.
|
|
|
|
SEGMENTS: 0x10,
|
|
|
|
// Stroke geometry (excluding color)
|
|
|
|
STROKE: 0x20,
|
|
|
|
// Fill style or stroke color / dash
|
|
|
|
STYLE: 0x40,
|
|
|
|
// Item attributes: visible, blendMode, locked, name, opacity, clipMask ...
|
|
|
|
ATTRIBUTE: 0x80,
|
|
|
|
// Text content
|
|
|
|
CONTENT: 0x100,
|
|
|
|
// Raster pixels
|
|
|
|
PIXELS: 0x200,
|
|
|
|
// Clipping in one of the child items
|
2016-01-16 09:10:19 -05:00
|
|
|
CLIPPING: 0x400,
|
|
|
|
// The view has been transformed
|
|
|
|
VIEW: 0x800
|
2011-06-19 17:20:28 -04:00
|
|
|
};
|
|
|
|
|
2011-06-19 17:36:04 -04:00
|
|
|
// Shortcuts to often used ChangeFlag values including APPEARANCE
|
2011-06-19 17:20:28 -04:00
|
|
|
var Change = {
|
2014-08-16 13:24:54 -04:00
|
|
|
// CHILDREN also changes GEOMETRY, since removing children from groups
|
|
|
|
// changes bounds.
|
|
|
|
CHILDREN: ChangeFlag.CHILDREN | ChangeFlag.GEOMETRY | ChangeFlag.APPEARANCE,
|
|
|
|
// Changing the insertion can change the appearance through parent's matrix.
|
|
|
|
INSERTION: ChangeFlag.INSERTION | ChangeFlag.APPEARANCE,
|
|
|
|
GEOMETRY: ChangeFlag.GEOMETRY | ChangeFlag.APPEARANCE,
|
|
|
|
SEGMENTS: ChangeFlag.SEGMENTS | ChangeFlag.GEOMETRY | ChangeFlag.APPEARANCE,
|
|
|
|
STROKE: ChangeFlag.STROKE | ChangeFlag.STYLE | ChangeFlag.APPEARANCE,
|
|
|
|
STYLE: ChangeFlag.STYLE | ChangeFlag.APPEARANCE,
|
|
|
|
ATTRIBUTE: ChangeFlag.ATTRIBUTE | ChangeFlag.APPEARANCE,
|
|
|
|
CONTENT: ChangeFlag.CONTENT | ChangeFlag.GEOMETRY | ChangeFlag.APPEARANCE,
|
2016-01-16 09:10:19 -05:00
|
|
|
PIXELS: ChangeFlag.PIXELS | ChangeFlag.APPEARANCE,
|
|
|
|
VIEW: ChangeFlag.VIEW | ChangeFlag.APPEARANCE
|
2011-05-07 11:52:54 -04:00
|
|
|
};
|