Skip to content

Commit 5349e12

Browse files
committed
update 2023-01-19
1 parent bb57780 commit 5349e12

File tree

211 files changed

+230
-224
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+230
-224
lines changed

konva.js

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
})(this, (function () { 'use strict';
66

77
/*
8-
* Konva JavaScript Framework v8.4.0
8+
* Konva JavaScript Framework v8.4.1
99
* http://konvajs.org/
1010
* Licensed under the MIT
11-
* Date: Thu Jan 05 2023
11+
* Date: Thu Jan 19 2023
1212
*
1313
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
1414
* Modified work Copyright (C) 2014 - present by Anton Lavrenov (Konva)
@@ -35,7 +35,7 @@
3535
: {};
3636
const Konva$2 = {
3737
_global: glob,
38-
version: '8.4.0',
38+
version: '8.4.1',
3939
isBrowser: detectBrowser(),
4040
isUnminified: /param/.test(function (param) { }.toString()),
4141
dblClickWindow: 400,
@@ -5355,22 +5355,27 @@
53555355
* add a child and children into container
53565356
* @name Konva.Container#add
53575357
* @method
5358-
* @param {...Konva.Node} child
5358+
* @param {...Konva.Node} children
53595359
* @returns {Container}
53605360
* @example
53615361
* layer.add(rect);
53625362
* layer.add(shape1, shape2, shape3);
5363+
* // empty arrays are accepted, though each individual child must be defined
5364+
* layer.add(...shapes);
53635365
* // remember to redraw layer if you changed something
53645366
* layer.draw();
53655367
*/
53665368
add(...children) {
5367-
if (arguments.length > 1) {
5368-
for (var i = 0; i < arguments.length; i++) {
5369-
this.add(arguments[i]);
5369+
if (children.length === 0) {
5370+
return this;
5371+
}
5372+
if (children.length > 1) {
5373+
for (var i = 0; i < children.length; i++) {
5374+
this.add(children[i]);
53705375
}
53715376
return this;
53725377
}
5373-
var child = children[0];
5378+
const child = children[0];
53745379
if (child.getParent()) {
53755380
child.moveTo(this);
53765381
return this;
@@ -13498,14 +13503,13 @@
1349813503
spacesNumber = text.split(' ').length - 1;
1349913504
oneWord = spacesNumber === 0;
1350013505
lineWidth =
13501-
align === JUSTIFY && lastLine && !oneWord
13502-
? totalWidth - padding * 2
13503-
: width;
13506+
align === JUSTIFY && !lastLine ? totalWidth - padding * 2 : width;
1350413507
context.lineTo(lineTranslateX + Math.round(lineWidth), translateY + lineTranslateY + Math.round(fontSize / 2));
1350513508
// I have no idea what is real ratio
1350613509
// just /15 looks good enough
1350713510
context.lineWidth = fontSize / 15;
13508-
context.strokeStyle = fill;
13511+
const gradient = this._getLinearGradient();
13512+
context.strokeStyle = gradient || fill;
1350913513
context.stroke();
1351013514
context.restore();
1351113515
}
@@ -13521,7 +13525,8 @@
1352113525
: width;
1352213526
context.lineTo(lineTranslateX + Math.round(lineWidth), translateY + lineTranslateY);
1352313527
context.lineWidth = fontSize / 15;
13524-
context.strokeStyle = fill;
13528+
const gradient = this._getLinearGradient();
13529+
context.strokeStyle = gradient || fill;
1352513530
context.stroke();
1352613531
context.restore();
1352713532
}
@@ -13627,7 +13632,8 @@
1362713632
normalizeFontFamily(this.fontFamily()));
1362813633
}
1362913634
_addTextLine(line) {
13630-
if (this.align() === JUSTIFY) {
13635+
const align = this.align();
13636+
if (align === JUSTIFY) {
1363113637
line = line.trim();
1363213638
}
1363313639
var width = this._getTextWidth(line);

main-demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"build": "parcel build index.html"
99
},
1010
"dependencies": {
11-
"konva": "8.4.0"
11+
"konva": "8.4.1"
1212
},
1313
"devDependencies": {
1414
"@babel/core": "8.3.5",

react-demos/animation_demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"konva"
99
],
1010
"dependencies": {
11-
"konva": "8.4.0",
11+
"konva": "8.4.1",
1212
"react": "18.0.0",
1313
"react-dom": "18.0.0",
1414
"react-konva": "18.0.0-0",

react-demos/basic_demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"konva"
99
],
1010
"dependencies": {
11-
"konva": "8.4.0",
11+
"konva": "8.4.1",
1212
"react": "18.0.0",
1313
"react-dom": "18.0.0",
1414
"react-konva": "18.0.0-0"

react-demos/canvas_portal/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"konva"
99
],
1010
"dependencies": {
11-
"konva": "8.4.0",
11+
"konva": "8.4.1",
1212
"react": "18.0.0",
1313
"react-dom": "18.0.0",
1414
"react-konva": "18.0.0-0",

react-demos/complex_animations/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
],
1010
"dependencies": {
1111
"@react-spring/konva": "9.2.3",
12-
"konva": "8.4.0",
12+
"konva": "8.4.1",
1313
"react": "18.0.0",
1414
"react-dom": "18.0.0",
1515
"react-konva": "18.0.0-0"

react-demos/custom_shape/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"konva"
99
],
1010
"dependencies": {
11-
"konva": "8.4.0",
11+
"konva": "8.4.1",
1212
"react": "18.0.0",
1313
"react-dom": "18.0.0",
1414
"react-konva": "18.0.0-0"

react-demos/dom_portal/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"konva"
99
],
1010
"dependencies": {
11-
"konva": "8.4.0",
11+
"konva": "8.4.1",
1212
"react": "18.0.0",
1313
"react-dom": "18.0.0",
1414
"react-konva": "18.0.0-0",

react-demos/drag_and_drop/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"konva"
99
],
1010
"dependencies": {
11-
"konva": "8.4.0",
11+
"konva": "8.4.1",
1212
"react": "18.0.0",
1313
"react-dom": "18.0.0",
1414
"react-konva": "18.0.0-0"

react-demos/drop_image_into_stage/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"konva"
99
],
1010
"dependencies": {
11-
"konva": "8.4.0",
11+
"konva": "8.4.1",
1212
"react": "18.0.0",
1313
"react-dom": "18.0.0",
1414
"react-konva": "18.0.0-0",

0 commit comments

Comments
 (0)