mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 15:23:44 +08:00
fix build
This commit is contained in:
parent
c29300e8cf
commit
4604126b57
@ -3,6 +3,8 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
|
- Fix cloning of `Konva.Transformer`
|
||||||
|
|
||||||
### 8.3.14 (2022-11-09)
|
### 8.3.14 (2022-11-09)
|
||||||
|
|
||||||
- Automatically release (destroy) used canvas elements. Should fix safari memory issues
|
- Automatically release (destroy) used canvas elements. Should fix safari memory issues
|
||||||
|
68
konva.js
68
konva.js
@ -8,7 +8,7 @@
|
|||||||
* Konva JavaScript Framework v8.3.14
|
* Konva JavaScript Framework v8.3.14
|
||||||
* http://konvajs.org/
|
* http://konvajs.org/
|
||||||
* Licensed under the MIT
|
* Licensed under the MIT
|
||||||
* Date: Wed Nov 09 2022
|
* Date: Sat Dec 17 2022
|
||||||
*
|
*
|
||||||
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
|
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
|
||||||
* Modified work Copyright (C) 2014 - present by Anton Lavrenov (Konva)
|
* Modified work Copyright (C) 2014 - present by Anton Lavrenov (Konva)
|
||||||
@ -759,7 +759,9 @@
|
|||||||
str = str || 'black';
|
str = str || 'black';
|
||||||
return (Util._namedColorToRBA(str) ||
|
return (Util._namedColorToRBA(str) ||
|
||||||
Util._hex3ColorToRGBA(str) ||
|
Util._hex3ColorToRGBA(str) ||
|
||||||
|
Util._hex4ColorToRGBA(str) ||
|
||||||
Util._hex6ColorToRGBA(str) ||
|
Util._hex6ColorToRGBA(str) ||
|
||||||
|
Util._hex8ColorToRGBA(str) ||
|
||||||
Util._rgbColorToRGBA(str) ||
|
Util._rgbColorToRGBA(str) ||
|
||||||
Util._rgbaColorToRGBA(str) ||
|
Util._rgbaColorToRGBA(str) ||
|
||||||
Util._hslColorToRGBA(str));
|
Util._hslColorToRGBA(str));
|
||||||
@ -808,6 +810,17 @@
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// Parse #nnnnnnnn
|
||||||
|
_hex8ColorToRGBA(str) {
|
||||||
|
if (str[0] === '#' && str.length === 9) {
|
||||||
|
return {
|
||||||
|
r: parseInt(str.slice(1, 3), 16),
|
||||||
|
g: parseInt(str.slice(3, 5), 16),
|
||||||
|
b: parseInt(str.slice(5, 7), 16),
|
||||||
|
a: parseInt(str.slice(7, 9), 16) / 0xff,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
// Parse #nnnnnn
|
// Parse #nnnnnn
|
||||||
_hex6ColorToRGBA(str) {
|
_hex6ColorToRGBA(str) {
|
||||||
if (str[0] === '#' && str.length === 7) {
|
if (str[0] === '#' && str.length === 7) {
|
||||||
@ -819,6 +832,17 @@
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// Parse #nnnn
|
||||||
|
_hex4ColorToRGBA(str) {
|
||||||
|
if (str[0] === '#' && str.length === 5) {
|
||||||
|
return {
|
||||||
|
r: parseInt(str[1] + str[1], 16),
|
||||||
|
g: parseInt(str[2] + str[2], 16),
|
||||||
|
b: parseInt(str[3] + str[3], 16),
|
||||||
|
a: parseInt(str[4] + str[4], 16) / 0xff,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
// Parse #nnn
|
// Parse #nnn
|
||||||
_hex3ColorToRGBA(str) {
|
_hex3ColorToRGBA(str) {
|
||||||
if (str[0] === '#' && str.length === 4) {
|
if (str[0] === '#' && str.length === 4) {
|
||||||
@ -1749,8 +1773,11 @@
|
|||||||
* @method
|
* @method
|
||||||
* @name Konva.Context#isPointInPath
|
* @name Konva.Context#isPointInPath
|
||||||
*/
|
*/
|
||||||
isPointInPath(x, y) {
|
isPointInPath(x, y, path, fillRule) {
|
||||||
return this._context.isPointInPath(x, y);
|
if (path) {
|
||||||
|
return this._context.isPointInPath(path, x, y, fillRule);
|
||||||
|
}
|
||||||
|
return this._context.isPointInPath(x, y, fillRule);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* fill function.
|
* fill function.
|
||||||
@ -15636,6 +15663,11 @@
|
|||||||
toObject() {
|
toObject() {
|
||||||
return Node.prototype.toObject.call(this);
|
return Node.prototype.toObject.call(this);
|
||||||
}
|
}
|
||||||
|
// overwrite clone to NOT use method from Container
|
||||||
|
clone(obj) {
|
||||||
|
var node = Node.prototype.clone.call(this, obj);
|
||||||
|
return node;
|
||||||
|
}
|
||||||
getClientRect() {
|
getClientRect() {
|
||||||
if (this.nodes().length > 0) {
|
if (this.nodes().length > 0) {
|
||||||
return super.getClientRect();
|
return super.getClientRect();
|
||||||
@ -15697,8 +15729,8 @@
|
|||||||
* get/set resize ability. If false it will automatically hide resizing handlers
|
* get/set resize ability. If false it will automatically hide resizing handlers
|
||||||
* @name Konva.Transformer#resizeEnabled
|
* @name Konva.Transformer#resizeEnabled
|
||||||
* @method
|
* @method
|
||||||
* @param {Array} array
|
* @param {Boolean} enabled
|
||||||
* @returns {Array}
|
* @returns {Boolean}
|
||||||
* @example
|
* @example
|
||||||
* // get
|
* // get
|
||||||
* var resizeEnabled = transformer.resizeEnabled();
|
* var resizeEnabled = transformer.resizeEnabled();
|
||||||
@ -15709,9 +15741,9 @@
|
|||||||
Factory.addGetterSetter(Transformer, 'resizeEnabled', true);
|
Factory.addGetterSetter(Transformer, 'resizeEnabled', true);
|
||||||
/**
|
/**
|
||||||
* get/set anchor size. Default is 10
|
* get/set anchor size. Default is 10
|
||||||
* @name Konva.Transformer#validateAnchors
|
* @name Konva.Transformer#anchorSize
|
||||||
* @method
|
* @method
|
||||||
* @param {Number} 10
|
* @param {Number} size
|
||||||
* @returns {Number}
|
* @returns {Number}
|
||||||
* @example
|
* @example
|
||||||
* // get
|
* // get
|
||||||
@ -15795,8 +15827,8 @@
|
|||||||
* get/set anchor stroke color
|
* get/set anchor stroke color
|
||||||
* @name Konva.Transformer#anchorStroke
|
* @name Konva.Transformer#anchorStroke
|
||||||
* @method
|
* @method
|
||||||
* @param {Boolean} enabled
|
* @param {String} strokeColor
|
||||||
* @returns {Boolean}
|
* @returns {String}
|
||||||
* @example
|
* @example
|
||||||
* // get
|
* // get
|
||||||
* var anchorStroke = transformer.anchorStroke();
|
* var anchorStroke = transformer.anchorStroke();
|
||||||
@ -15809,8 +15841,8 @@
|
|||||||
* get/set anchor stroke width
|
* get/set anchor stroke width
|
||||||
* @name Konva.Transformer#anchorStrokeWidth
|
* @name Konva.Transformer#anchorStrokeWidth
|
||||||
* @method
|
* @method
|
||||||
* @param {Boolean} enabled
|
* @param {Number} anchorStrokeWidth
|
||||||
* @returns {Boolean}
|
* @returns {Number}
|
||||||
* @example
|
* @example
|
||||||
* // get
|
* // get
|
||||||
* var anchorStrokeWidth = transformer.anchorStrokeWidth();
|
* var anchorStrokeWidth = transformer.anchorStrokeWidth();
|
||||||
@ -15823,8 +15855,8 @@
|
|||||||
* get/set anchor fill color
|
* get/set anchor fill color
|
||||||
* @name Konva.Transformer#anchorFill
|
* @name Konva.Transformer#anchorFill
|
||||||
* @method
|
* @method
|
||||||
* @param {Boolean} enabled
|
* @param {String} anchorFill
|
||||||
* @returns {Boolean}
|
* @returns {String}
|
||||||
* @example
|
* @example
|
||||||
* // get
|
* // get
|
||||||
* var anchorFill = transformer.anchorFill();
|
* var anchorFill = transformer.anchorFill();
|
||||||
@ -15837,7 +15869,7 @@
|
|||||||
* get/set anchor corner radius
|
* get/set anchor corner radius
|
||||||
* @name Konva.Transformer#anchorCornerRadius
|
* @name Konva.Transformer#anchorCornerRadius
|
||||||
* @method
|
* @method
|
||||||
* @param {Number} enabled
|
* @param {Number} radius
|
||||||
* @returns {Number}
|
* @returns {Number}
|
||||||
* @example
|
* @example
|
||||||
* // get
|
* // get
|
||||||
@ -15865,8 +15897,8 @@
|
|||||||
* get/set border stroke width
|
* get/set border stroke width
|
||||||
* @name Konva.Transformer#borderStrokeWidth
|
* @name Konva.Transformer#borderStrokeWidth
|
||||||
* @method
|
* @method
|
||||||
* @param {Boolean} enabled
|
* @param {Number} strokeWidth
|
||||||
* @returns {Boolean}
|
* @returns {Number}
|
||||||
* @example
|
* @example
|
||||||
* // get
|
* // get
|
||||||
* var borderStrokeWidth = transformer.borderStrokeWidth();
|
* var borderStrokeWidth = transformer.borderStrokeWidth();
|
||||||
@ -15879,8 +15911,8 @@
|
|||||||
* get/set border dash array
|
* get/set border dash array
|
||||||
* @name Konva.Transformer#borderDash
|
* @name Konva.Transformer#borderDash
|
||||||
* @method
|
* @method
|
||||||
* @param {Boolean} enabled
|
* @param {Array} dash array
|
||||||
* @returns {Boolean}
|
* @returns {Array}
|
||||||
* @example
|
* @example
|
||||||
* // get
|
* // get
|
||||||
* var borderDash = transformer.borderDash();
|
* var borderDash = transformer.borderDash();
|
||||||
|
4
konva.min.js
vendored
4
konva.min.js
vendored
File diff suppressed because one or more lines are too long
@ -52,7 +52,7 @@
|
|||||||
"test:node": "ts-mocha -p ./test/tsconfig.json test/unit/**/*.ts --exit && npm run test:import",
|
"test:node": "ts-mocha -p ./test/tsconfig.json test/unit/**/*.ts --exit && npm run test:import",
|
||||||
"test:watch": "rm -rf ./parcel-cache && parcel serve ./test/unit-tests.html ./test/manual-tests.html ./test/sandbox.html",
|
"test:watch": "rm -rf ./parcel-cache && parcel serve ./test/unit-tests.html ./test/manual-tests.html ./test/sandbox.html",
|
||||||
"tsc": "tsc --removeComments && tsc --build ./tsconfig-cmj.json",
|
"tsc": "tsc --removeComments && tsc --build ./tsconfig-cmj.json",
|
||||||
"rollup": "rollup -c",
|
"rollup": "rollup -c --bundleConfigAsCjs",
|
||||||
"clean": "rm -rf ./lib && rm -rf ./types && rm -rf ./cmj && rm -rf ./test-build",
|
"clean": "rm -rf ./lib && rm -rf ./types && rm -rf ./cmj && rm -rf ./test-build",
|
||||||
"watch": "rollup -c -w",
|
"watch": "rollup -c -w",
|
||||||
"size": "size-limit"
|
"size": "size-limit"
|
||||||
|
Loading…
Reference in New Issue
Block a user