mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Fix a row of documentation issues.
This commit is contained in:
parent
71ed477bc4
commit
4e1db6a1d1
6 changed files with 25 additions and 15 deletions
|
@ -33,6 +33,5 @@ cd ..
|
|||
if [ $MODE = "docs" ]
|
||||
then
|
||||
# Build paper.js library for documentation
|
||||
./preprocess.sh stripped ../src/paper.js ../dist/docs/resources/js/paper.js\
|
||||
'{ "browser": true }'
|
||||
./preprocess.sh stripped ../src/paper.js '{ "browser": true }' ../src/constants.js ../dist/docs/resources/js/paper.js
|
||||
fi
|
||||
|
|
|
@ -14,6 +14,10 @@
|
|||
* All rights reserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @name Callback
|
||||
* @namespace
|
||||
*/
|
||||
var Callback = {
|
||||
attach: function(type, func) {
|
||||
// If an object literal is passed, attach all callbacks defined in it
|
||||
|
|
|
@ -362,8 +362,10 @@ new function() {
|
|||
return setAttributes(svg, attrs);
|
||||
}
|
||||
|
||||
Item.inject(/** @Lends Item# */{
|
||||
Item.inject(/** @lends Item# */{
|
||||
/**
|
||||
* {@grouptitle SVG Conversion}
|
||||
*
|
||||
* Exports the item and all its child items as an SVG DOM, all contained
|
||||
* in one top level SVG group node.
|
||||
*
|
||||
|
@ -376,8 +378,10 @@ new function() {
|
|||
}
|
||||
});
|
||||
|
||||
Project.inject(/** @Lends Project# */{
|
||||
Project.inject(/** @lends Project# */{
|
||||
/**
|
||||
* {@grouptitle SVG Conversion}
|
||||
*
|
||||
* Exports the project and all its layers and child items as an SVG DOM,
|
||||
* all contained in one top level SVG group node.
|
||||
*
|
||||
|
|
|
@ -421,7 +421,7 @@ new function() {
|
|||
}
|
||||
|
||||
|
||||
Item.inject(/** @Lends Item# */{
|
||||
Item.inject(/** @lends Item# */{
|
||||
/**
|
||||
* Converts the passed svg node into a Paper.js item and adds it to the
|
||||
* children of this item.
|
||||
|
@ -434,7 +434,7 @@ new function() {
|
|||
}
|
||||
});
|
||||
|
||||
Project.inject(/** @Lends Project# */{
|
||||
Project.inject(/** @lends Project# */{
|
||||
/**
|
||||
* Converts the passed svg node into a Paper.js item and adds it to the
|
||||
* active layer of this project.
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
/**
|
||||
* @name CanvasView
|
||||
*
|
||||
* @class
|
||||
* @private
|
||||
*/
|
||||
var CanvasView = View.extend(/** @lends CanvasView# */{
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
* @class The ProxyContext is a helper class that helps Canvas debugging
|
||||
* by logging all interactions with a 2D Canvas context.
|
||||
*
|
||||
* @private
|
||||
*
|
||||
* @classexample
|
||||
* view._context = new ProxyContext(view._context);
|
||||
*/
|
||||
|
@ -46,11 +48,12 @@ var ProxyContext = new function() {
|
|||
'createImageData(imagedata)', 'getImageData(sx,sy,sw,sh)',
|
||||
'putImageData(imagedata,dx,dy,dirtyX,dirtyY,dirtyWidth,dirtyHeight)'
|
||||
];
|
||||
var param = {
|
||||
var fields = /** @lends ProxyContext# */ {
|
||||
initialize: function(context) {
|
||||
this._ctx = context;
|
||||
this._indents = 0;
|
||||
},
|
||||
|
||||
getIndentation: function() {
|
||||
var str = '';
|
||||
for (var i = 0; i < this._indents; i++) {
|
||||
|
@ -60,11 +63,11 @@ var ProxyContext = new function() {
|
|||
}
|
||||
};
|
||||
Base.each(descriptions, function(description) {
|
||||
var matches = description.match(/^([^(]+)(\()*/),
|
||||
name = matches[1],
|
||||
isFunction = !!matches[2];
|
||||
var match = description.match(/^([^(]+)(\()*/),
|
||||
name = match[1],
|
||||
isFunction = !!match[2];
|
||||
if (isFunction) {
|
||||
param[name] = function() {
|
||||
fields[name] = function() {
|
||||
if (name == 'restore') {
|
||||
this._indents--;
|
||||
}
|
||||
|
@ -78,16 +81,16 @@ var ProxyContext = new function() {
|
|||
};
|
||||
} else {
|
||||
var capitalized = Base.capitalize(name);
|
||||
param['set' + capitalized] = function(value) {
|
||||
fields['set' + capitalized] = function(value) {
|
||||
var logValue = value && value.substring ? '\'' + value + '\'' : value,
|
||||
string = 'ctx.' + name + ' = ' + logValue + ';';
|
||||
console.log(this.getIndentation() + string);
|
||||
return this._ctx[name] = value;
|
||||
};
|
||||
param['get' + capitalized] = function() {
|
||||
fields['get' + capitalized] = function() {
|
||||
return this._ctx[name];
|
||||
};
|
||||
}
|
||||
});
|
||||
return Base.extend(param);
|
||||
return Base.extend(fields);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue