mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Begin adding support for guides.
This commit is contained in:
parent
133e0fc5cf
commit
3bd6122e82
1 changed files with 14 additions and 3 deletions
|
@ -207,7 +207,7 @@ var Item = this.Item = Base.extend(/** @lends Item# */{
|
|||
}, new function() { // Injection scope to produce getter setters for properties
|
||||
// We need setters because we want to call _changed() if a property was
|
||||
// modified.
|
||||
return Base.each(['locked', 'visible', 'blendMode', 'opacity'],
|
||||
return Base.each(['locked', 'visible', 'blendMode', 'opacity', 'guide'],
|
||||
function(name) {
|
||||
var part = Base.capitalize(name),
|
||||
name = '_' + name;
|
||||
|
@ -308,6 +308,17 @@ var Item = this.Item = Base.extend(/** @lends Item# */{
|
|||
*/
|
||||
_opacity: 1,
|
||||
|
||||
// TODO: Implement guides
|
||||
/**
|
||||
* Specifies whether the item functions as a guide. When set to
|
||||
* {@code true}, the item will be drawn at the end as a guide.
|
||||
*
|
||||
* @name Item#guide
|
||||
* @type Number
|
||||
* @default 1
|
||||
*/
|
||||
_guide: false,
|
||||
|
||||
/**
|
||||
* Specifies whether an item is selected and will also return {@code true}
|
||||
* if the item is partially selected (groups with some selected or partially
|
||||
|
@ -581,8 +592,8 @@ var Item = this.Item = Base.extend(/** @lends Item# */{
|
|||
// Only copy over these fields if they are actually defined in 'this'
|
||||
// TODO: Consider moving this to Base once it's useful in more than one
|
||||
// place
|
||||
var keys = ['_locked', '_visible', '_opacity', '_blendMode',
|
||||
'_clipMask'];
|
||||
var keys = ['_locked', '_visible', '_blendMode', '_opacity',
|
||||
'_clipMask', '_guide'];
|
||||
for (var i = 0, l = keys.length; i < l; i++) {
|
||||
var key = keys[i];
|
||||
if (this.hasOwnProperty(key))
|
||||
|
|
Loading…
Reference in a new issue