paper.js/src/item/ChangeFlag.js

52 lines
1.7 KiB
JavaScript
Raw Normal View History

/*
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
2014-01-03 19:47:16 -05:00
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
2011-07-01 06:17:45 -04:00
* Distributed under the MIT license. See LICENSE file for details.
*
* All rights reserved.
*/
2011-06-19 17:21:14 -04:00
var ChangeFlag = {
// Anything affecting the appearance of an item, including GEOMETRY,
// STROKE, STYLE and ATTRIBUTE (except for the invisible ones: locked, name)
APPEARANCE: 0x1,
// Change in item hierarchy
HIERARCHY: 0x2,
// Item geometry (path, bounds)
GEOMETRY: 0x4,
// Only segment(s) have changed, and affected curves have alredy been
// notified. This is to implement an optimization in _changed() calls.
SEGMENTS: 0x8,
// Stroke geometry (excluding color)
STROKE: 0x10,
// Fill style or stroke color / dash
STYLE: 0x20,
// Item attributes: visible, blendMode, locked, name, opacity, clipMask ...
ATTRIBUTE: 0x40,
// Text content
CONTENT: 0x80,
// Raster pixels
PIXELS: 0x100,
// Clipping in one of the child items
CLIPPING: 0x200
};
// Shortcuts to often used ChangeFlag values including APPEARANCE
var Change = {
// HIERARCHY also changes GEOMETRY, since removing children from groups
// change bounds
HIERARCHY: ChangeFlag.HIERARCHY | ChangeFlag.GEOMETRY
| ChangeFlag.APPEARANCE,
2011-06-19 17:21:14 -04:00
GEOMETRY: ChangeFlag.GEOMETRY | ChangeFlag.APPEARANCE,
SEGMENTS: ChangeFlag.SEGMENTS | ChangeFlag.GEOMETRY | ChangeFlag.APPEARANCE,
STROKE: ChangeFlag.STROKE | ChangeFlag.STYLE | ChangeFlag.APPEARANCE,
2011-06-19 17:21:14 -04:00
STYLE: ChangeFlag.STYLE | ChangeFlag.APPEARANCE,
ATTRIBUTE: ChangeFlag.ATTRIBUTE | ChangeFlag.APPEARANCE,
CONTENT: ChangeFlag.CONTENT | ChangeFlag.GEOMETRY | ChangeFlag.APPEARANCE,
PIXELS: ChangeFlag.PIXELS | ChangeFlag.APPEARANCE
};