mirror of
https://github.com/konvajs/konva.git
synced 2025-11-24 08:46:44 +08:00
docs fixes
This commit is contained in:
53
konva.js
53
konva.js
@@ -2,7 +2,7 @@
|
||||
* Konva JavaScript Framework v2.0.2
|
||||
* http://konvajs.github.io/
|
||||
* Licensed under the MIT
|
||||
* Date: Fri Mar 16 2018
|
||||
* Date: Mon Mar 19 2018
|
||||
*
|
||||
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
|
||||
* Modified work Copyright (C) 2014 - present by Anton Lavrenov (Konva)
|
||||
@@ -4450,10 +4450,10 @@
|
||||
* @param {Number} blur
|
||||
* @returns {Number}
|
||||
* @example
|
||||
* // get shadow blur
|
||||
* // get globalCompositeOperation
|
||||
* var globalCompositeOperation = shape.globalCompositeOperation();
|
||||
*
|
||||
* // set shadow blur
|
||||
* // set globalCompositeOperation
|
||||
* shape.globalCompositeOperation('source-in');
|
||||
*/
|
||||
Konva.Factory.addGetterSetter(Konva.Node, 'opacity', 1);
|
||||
@@ -6706,7 +6706,9 @@
|
||||
'use strict';
|
||||
function remap(fromValue, fromMin, fromMax, toMin, toMax) {
|
||||
// Compute the range of the data
|
||||
var fromRange = fromMax - fromMin, toRange = toMax - toMin, toValue;
|
||||
var fromRange = fromMax - fromMin,
|
||||
toRange = toMax - toMin,
|
||||
toValue;
|
||||
|
||||
// If either range is 0, then the value can only be mapped to 1 value
|
||||
if (fromRange === 0) {
|
||||
@@ -6724,19 +6726,19 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Enhance Filter. Adjusts the colors so that they span the widest
|
||||
* possible range (ie 0-255). Performs w*h pixel reads and w*h pixel
|
||||
* writes.
|
||||
* @function
|
||||
* @name Enhance
|
||||
* @memberof Konva.Filters
|
||||
* @param {Object} imageData
|
||||
* @author ippo615
|
||||
* @example
|
||||
* node.cache();
|
||||
* node.filters([Konva.Filters.Enhance]);
|
||||
* node.enhance(0.4);
|
||||
*/
|
||||
* Enhance Filter. Adjusts the colors so that they span the widest
|
||||
* possible range (ie 0-255). Performs w*h pixel reads and w*h pixel
|
||||
* writes.
|
||||
* @function
|
||||
* @name Enhance
|
||||
* @memberof Konva.Filters
|
||||
* @param {Object} imageData
|
||||
* @author ippo615
|
||||
* @example
|
||||
* node.cache();
|
||||
* node.filters([Konva.Filters.Enhance]);
|
||||
* node.enhance(0.4);
|
||||
*/
|
||||
Konva.Filters.Enhance = function(imageData) {
|
||||
var data = imageData.data,
|
||||
nSubPixels = data.length,
|
||||
@@ -6836,6 +6838,14 @@
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* get/set enhance. Use with {@link Konva.Filters.Enhance} filter. -1 to 1 values
|
||||
* @name enhance
|
||||
* @method
|
||||
* @memberof Konva.Node.prototype
|
||||
* @param {Float} amount
|
||||
* @returns {Float}
|
||||
*/
|
||||
Konva.Factory.addGetterSetter(
|
||||
Konva.Node,
|
||||
'enhance',
|
||||
@@ -6843,15 +6853,6 @@
|
||||
null,
|
||||
Konva.Factory.afterSetFilter
|
||||
);
|
||||
|
||||
/**
|
||||
* get/set enhance. Use with {@link Konva.Filters.Enhance} filter.
|
||||
* @name enhance
|
||||
* @method
|
||||
* @memberof Konva.Node.prototype
|
||||
* @param {Float} amount
|
||||
* @returns {Float}
|
||||
*/
|
||||
})();
|
||||
|
||||
(function() {
|
||||
|
||||
2
konva.min.js
vendored
2
konva.min.js
vendored
@@ -2,7 +2,7 @@
|
||||
* Konva JavaScript Framework v2.0.2
|
||||
* http://konvajs.github.io/
|
||||
* Licensed under the MIT
|
||||
* Date: Fri Mar 16 2018
|
||||
* Date: Mon Mar 19 2018
|
||||
*
|
||||
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
|
||||
* Modified work Copyright (C) 2014 - present by Anton Lavrenov (Konva)
|
||||
|
||||
@@ -2095,10 +2095,10 @@
|
||||
* @param {Number} blur
|
||||
* @returns {Number}
|
||||
* @example
|
||||
* // get shadow blur
|
||||
* // get globalCompositeOperation
|
||||
* var globalCompositeOperation = shape.globalCompositeOperation();
|
||||
*
|
||||
* // set shadow blur
|
||||
* // set globalCompositeOperation
|
||||
* shape.globalCompositeOperation('source-in');
|
||||
*/
|
||||
Konva.Factory.addGetterSetter(Konva.Node, 'opacity', 1);
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
'use strict';
|
||||
function remap(fromValue, fromMin, fromMax, toMin, toMax) {
|
||||
// Compute the range of the data
|
||||
var fromRange = fromMax - fromMin, toRange = toMax - toMin, toValue;
|
||||
var fromRange = fromMax - fromMin,
|
||||
toRange = toMax - toMin,
|
||||
toValue;
|
||||
|
||||
// If either range is 0, then the value can only be mapped to 1 value
|
||||
if (fromRange === 0) {
|
||||
@@ -20,19 +22,19 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Enhance Filter. Adjusts the colors so that they span the widest
|
||||
* possible range (ie 0-255). Performs w*h pixel reads and w*h pixel
|
||||
* writes.
|
||||
* @function
|
||||
* @name Enhance
|
||||
* @memberof Konva.Filters
|
||||
* @param {Object} imageData
|
||||
* @author ippo615
|
||||
* @example
|
||||
* node.cache();
|
||||
* node.filters([Konva.Filters.Enhance]);
|
||||
* node.enhance(0.4);
|
||||
*/
|
||||
* Enhance Filter. Adjusts the colors so that they span the widest
|
||||
* possible range (ie 0-255). Performs w*h pixel reads and w*h pixel
|
||||
* writes.
|
||||
* @function
|
||||
* @name Enhance
|
||||
* @memberof Konva.Filters
|
||||
* @param {Object} imageData
|
||||
* @author ippo615
|
||||
* @example
|
||||
* node.cache();
|
||||
* node.filters([Konva.Filters.Enhance]);
|
||||
* node.enhance(0.4);
|
||||
*/
|
||||
Konva.Filters.Enhance = function(imageData) {
|
||||
var data = imageData.data,
|
||||
nSubPixels = data.length,
|
||||
@@ -132,6 +134,14 @@
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* get/set enhance. Use with {@link Konva.Filters.Enhance} filter. -1 to 1 values
|
||||
* @name enhance
|
||||
* @method
|
||||
* @memberof Konva.Node.prototype
|
||||
* @param {Float} amount
|
||||
* @returns {Float}
|
||||
*/
|
||||
Konva.Factory.addGetterSetter(
|
||||
Konva.Node,
|
||||
'enhance',
|
||||
@@ -139,13 +149,4 @@
|
||||
null,
|
||||
Konva.Factory.afterSetFilter
|
||||
);
|
||||
|
||||
/**
|
||||
* get/set enhance. Use with {@link Konva.Filters.Enhance} filter.
|
||||
* @name enhance
|
||||
* @method
|
||||
* @memberof Konva.Node.prototype
|
||||
* @param {Float} amount
|
||||
* @returns {Float}
|
||||
*/
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user