konva 10.10.0 → 10.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/konva.js +258 -70
- package/konva.min.js +4 -4
- package/lib/Container.js +3 -2
- package/lib/Context.js +10 -20
- package/lib/Global.js +2 -2
- package/lib/Node.d.ts +3 -1
- package/lib/Node.js +73 -40
- package/lib/Shape.d.ts +8 -1
- package/lib/Shape.js +121 -5
- package/lib/Util.js +1 -1
- package/package.json +1 -1
package/konva.js
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
})(this, (function () { 'use strict';
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
* Konva JavaScript Framework v10.
|
|
8
|
+
* Konva JavaScript Framework v10.11.0
|
|
9
9
|
* http://konvajs.org/
|
|
10
10
|
* Licensed under the MIT
|
|
11
|
-
* Date:
|
|
11
|
+
* Date: Mon Nov 23 2026
|
|
12
12
|
*
|
|
13
13
|
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
|
|
14
14
|
* Modified work Copyright (C) 2014 - present by Anton Lavrenov (Konva)
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
: {};
|
|
36
36
|
const Konva$2 = {
|
|
37
37
|
_global: glob,
|
|
38
|
-
version: '10.
|
|
38
|
+
version: '10.11.0',
|
|
39
39
|
isBrowser: detectBrowser(),
|
|
40
40
|
isUnminified: /param/.test(function (param) { }.toString()),
|
|
41
41
|
dblClickWindow: 400,
|
|
@@ -739,7 +739,7 @@
|
|
|
739
739
|
return val instanceof Object;
|
|
740
740
|
},
|
|
741
741
|
isValidSelector(selector) {
|
|
742
|
-
if (typeof selector !== 'string') {
|
|
742
|
+
if (typeof selector !== 'string' || !selector) {
|
|
743
743
|
return false;
|
|
744
744
|
}
|
|
745
745
|
const firstChar = selector[0];
|
|
@@ -2170,26 +2170,16 @@
|
|
|
2170
2170
|
}
|
|
2171
2171
|
_getFillStyle(shape) {
|
|
2172
2172
|
const color = shape.fill();
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
if (radial && priority === 'radial-gradient')
|
|
2184
|
-
return shape._getRadialGradient();
|
|
2185
|
-
if (color)
|
|
2186
|
-
return color;
|
|
2187
|
-
if (pattern)
|
|
2188
|
-
return this._getFillPattern(shape);
|
|
2189
|
-
if (linear)
|
|
2190
|
-
return shape._getLinearGradient();
|
|
2191
|
-
if (radial)
|
|
2192
|
-
return shape._getRadialGradient();
|
|
2173
|
+
switch (shape._getFillType(color)) {
|
|
2174
|
+
case 'color':
|
|
2175
|
+
return color;
|
|
2176
|
+
case 'pattern':
|
|
2177
|
+
return this._getFillPattern(shape);
|
|
2178
|
+
case 'linear-gradient':
|
|
2179
|
+
return shape._getLinearGradient();
|
|
2180
|
+
case 'radial-gradient':
|
|
2181
|
+
return shape._getRadialGradient();
|
|
2182
|
+
}
|
|
2193
2183
|
}
|
|
2194
2184
|
_fill(shape) {
|
|
2195
2185
|
const style = this._getFillStyle(shape);
|
|
@@ -3213,6 +3203,56 @@
|
|
|
3213
3203
|
'transformsEnabledChange.konva',
|
|
3214
3204
|
].join(SPACE$1);
|
|
3215
3205
|
let idCounter$1 = 1;
|
|
3206
|
+
const WHITESPACE = /\s/;
|
|
3207
|
+
const matchNothing = () => false;
|
|
3208
|
+
// Turn a selector like "#id, .name, Rect" into a test for one node.
|
|
3209
|
+
// find(), findAncestors() and delegated events test many nodes against the
|
|
3210
|
+
// same selector, so they parse it once with this.
|
|
3211
|
+
function _parseSelector(selector) {
|
|
3212
|
+
if (typeof selector === 'function') {
|
|
3213
|
+
return selector;
|
|
3214
|
+
}
|
|
3215
|
+
if (!selector) {
|
|
3216
|
+
return matchNothing;
|
|
3217
|
+
}
|
|
3218
|
+
const ids = [], names = [], types = [];
|
|
3219
|
+
for (const sel of selector.replace(/ /g, '').split(',')) {
|
|
3220
|
+
if (!Util.isValidSelector(sel)) {
|
|
3221
|
+
Util.warn('Selector "' +
|
|
3222
|
+
sel +
|
|
3223
|
+
'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".');
|
|
3224
|
+
Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".');
|
|
3225
|
+
Util.warn('Konva is awesome, right?');
|
|
3226
|
+
}
|
|
3227
|
+
if (sel.charAt(0) === '#') {
|
|
3228
|
+
ids.push(sel.slice(1));
|
|
3229
|
+
}
|
|
3230
|
+
else if (sel.charAt(0) === '.') {
|
|
3231
|
+
names.push(sel.slice(1));
|
|
3232
|
+
}
|
|
3233
|
+
else {
|
|
3234
|
+
types.push(sel);
|
|
3235
|
+
}
|
|
3236
|
+
}
|
|
3237
|
+
// runs for every visited node: the length guards and the plain loop
|
|
3238
|
+
// (instead of names.some()) measured ~40% faster on find('#id') and find('Rect')
|
|
3239
|
+
return (node) => {
|
|
3240
|
+
if (ids.length && ids.indexOf(node.id()) !== -1) {
|
|
3241
|
+
return true;
|
|
3242
|
+
}
|
|
3243
|
+
if (types.length &&
|
|
3244
|
+
(types.indexOf(node.className) !== -1 ||
|
|
3245
|
+
types.indexOf(node.nodeType) !== -1)) {
|
|
3246
|
+
return true;
|
|
3247
|
+
}
|
|
3248
|
+
for (let i = 0; i < names.length; i++) {
|
|
3249
|
+
if (node.hasName(names[i])) {
|
|
3250
|
+
return true;
|
|
3251
|
+
}
|
|
3252
|
+
}
|
|
3253
|
+
return false;
|
|
3254
|
+
};
|
|
3255
|
+
}
|
|
3216
3256
|
/**
|
|
3217
3257
|
* Node constructor. Nodes are entities that can be transformed, layered,
|
|
3218
3258
|
* and have bound events. The stage, layers, groups, and shapes all extend Node.
|
|
@@ -3846,9 +3886,11 @@
|
|
|
3846
3886
|
// like node.on
|
|
3847
3887
|
_delegate(event, selector, handler) {
|
|
3848
3888
|
const stopNode = this;
|
|
3889
|
+
// parse once here, not on every event
|
|
3890
|
+
const match = _parseSelector(selector);
|
|
3849
3891
|
this.on(event, function (evt) {
|
|
3850
3892
|
const original = evt;
|
|
3851
|
-
const targets = evt.target.findAncestors(
|
|
3893
|
+
const targets = evt.target.findAncestors(match, true, stopNode);
|
|
3852
3894
|
for (let i = 0; i < targets.length; i++) {
|
|
3853
3895
|
evt = Util.cloneObject(evt);
|
|
3854
3896
|
evt.currentTarget = targets[i];
|
|
@@ -4526,7 +4568,8 @@
|
|
|
4526
4568
|
*/
|
|
4527
4569
|
findAncestors(selector, includeSelf, stopNode) {
|
|
4528
4570
|
const res = [];
|
|
4529
|
-
|
|
4571
|
+
const match = _parseSelector(selector);
|
|
4572
|
+
if (includeSelf && match(this)) {
|
|
4530
4573
|
res.push(this);
|
|
4531
4574
|
}
|
|
4532
4575
|
let ancestor = this.parent;
|
|
@@ -4534,7 +4577,7 @@
|
|
|
4534
4577
|
if (ancestor === stopNode) {
|
|
4535
4578
|
return res;
|
|
4536
4579
|
}
|
|
4537
|
-
if (ancestor
|
|
4580
|
+
if (match(ancestor)) {
|
|
4538
4581
|
res.push(ancestor);
|
|
4539
4582
|
}
|
|
4540
4583
|
ancestor = ancestor.parent;
|
|
@@ -4559,41 +4602,10 @@
|
|
|
4559
4602
|
findAncestor(selector, includeSelf, stopNode) {
|
|
4560
4603
|
return this.findAncestors(selector, includeSelf, stopNode)[0];
|
|
4561
4604
|
}
|
|
4562
|
-
//
|
|
4605
|
+
// does this node match the selector? Konva itself uses _parseSelector to
|
|
4606
|
+
// parse once per call; this stays for code outside Konva that calls it
|
|
4563
4607
|
_isMatch(selector) {
|
|
4564
|
-
|
|
4565
|
-
return false;
|
|
4566
|
-
}
|
|
4567
|
-
if (typeof selector === 'function') {
|
|
4568
|
-
return selector(this);
|
|
4569
|
-
}
|
|
4570
|
-
let selectorArr = selector.replace(/ /g, '').split(','), len = selectorArr.length, n, sel;
|
|
4571
|
-
for (n = 0; n < len; n++) {
|
|
4572
|
-
sel = selectorArr[n];
|
|
4573
|
-
if (!Util.isValidSelector(sel)) {
|
|
4574
|
-
Util.warn('Selector "' +
|
|
4575
|
-
sel +
|
|
4576
|
-
'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".');
|
|
4577
|
-
Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".');
|
|
4578
|
-
Util.warn('Konva is awesome, right?');
|
|
4579
|
-
}
|
|
4580
|
-
// id selector
|
|
4581
|
-
if (sel.charAt(0) === '#') {
|
|
4582
|
-
if (this.id() === sel.slice(1)) {
|
|
4583
|
-
return true;
|
|
4584
|
-
}
|
|
4585
|
-
}
|
|
4586
|
-
else if (sel.charAt(0) === '.') {
|
|
4587
|
-
// name selector
|
|
4588
|
-
if (this.hasName(sel.slice(1))) {
|
|
4589
|
-
return true;
|
|
4590
|
-
}
|
|
4591
|
-
}
|
|
4592
|
-
else if (this.className === sel || this.nodeType === sel) {
|
|
4593
|
-
return true;
|
|
4594
|
-
}
|
|
4595
|
-
}
|
|
4596
|
-
return false;
|
|
4608
|
+
return _parseSelector(selector)(this);
|
|
4597
4609
|
}
|
|
4598
4610
|
/**
|
|
4599
4611
|
* get layer ancestor
|
|
@@ -5143,9 +5155,20 @@
|
|
|
5143
5155
|
if (!fullName) {
|
|
5144
5156
|
return false;
|
|
5145
5157
|
}
|
|
5146
|
-
//
|
|
5147
|
-
|
|
5148
|
-
|
|
5158
|
+
// find('.name') calls this for every node, so look for a whole
|
|
5159
|
+
// whitespace-separated word instead of splitting fullName into an array
|
|
5160
|
+
let i = fullName.indexOf(name);
|
|
5161
|
+
while (i !== -1) {
|
|
5162
|
+
const end = i + name.length;
|
|
5163
|
+
if ((i === 0 || WHITESPACE.test(fullName[i - 1])) &&
|
|
5164
|
+
(end === fullName.length || WHITESPACE.test(fullName[end]))) {
|
|
5165
|
+
// a word never contains whitespace; checked only on a hit so the
|
|
5166
|
+
// common miss in find('.name') stays cheap (~25% faster than up front)
|
|
5167
|
+
return !WHITESPACE.test(name);
|
|
5168
|
+
}
|
|
5169
|
+
i = fullName.indexOf(name, i + 1);
|
|
5170
|
+
}
|
|
5171
|
+
return false;
|
|
5149
5172
|
}
|
|
5150
5173
|
/**
|
|
5151
5174
|
* remove name from node
|
|
@@ -6368,8 +6391,9 @@
|
|
|
6368
6391
|
}
|
|
6369
6392
|
_generalFind(selector, findOne) {
|
|
6370
6393
|
const retArr = [];
|
|
6394
|
+
const match = _parseSelector(selector);
|
|
6371
6395
|
this._descendants((node) => {
|
|
6372
|
-
const valid = node
|
|
6396
|
+
const valid = match(node);
|
|
6373
6397
|
if (valid) {
|
|
6374
6398
|
retArr.push(node);
|
|
6375
6399
|
}
|
|
@@ -7773,7 +7797,7 @@
|
|
|
7773
7797
|
const linearGradient = 'linearGradient';
|
|
7774
7798
|
const radialGradient = 'radialGradient';
|
|
7775
7799
|
const shapes = {};
|
|
7776
|
-
function
|
|
7800
|
+
function fillPath(context) {
|
|
7777
7801
|
const fillRule = this.attrs.fillRule;
|
|
7778
7802
|
if (fillRule) {
|
|
7779
7803
|
context.fill(fillRule);
|
|
@@ -7782,6 +7806,46 @@
|
|
|
7782
7806
|
context.fill();
|
|
7783
7807
|
}
|
|
7784
7808
|
}
|
|
7809
|
+
// Below this scale the ellipse is under a millionth of its radius across, so
|
|
7810
|
+
// only its last color stop shows.
|
|
7811
|
+
const MIN_GRADIENT_SCALE = 1e-6;
|
|
7812
|
+
// Fills the current path. A canvas maps the path when it is built and the
|
|
7813
|
+
// fill style when it is painted, so a transform set here moves only the
|
|
7814
|
+
// gradient: that is how fillRadialGradientScale makes an ellipse.
|
|
7815
|
+
function _fillFunc$2(context) {
|
|
7816
|
+
const scaleX = this.fillRadialGradientScaleX();
|
|
7817
|
+
const scaleY = this.fillRadialGradientScaleY();
|
|
7818
|
+
if ((scaleX === 1 && scaleY === 1) ||
|
|
7819
|
+
this._getFillType() !== 'radial-gradient') {
|
|
7820
|
+
fillPath.call(this, context);
|
|
7821
|
+
return;
|
|
7822
|
+
}
|
|
7823
|
+
const min = Math.min(Math.abs(scaleX), Math.abs(scaleY));
|
|
7824
|
+
context.save();
|
|
7825
|
+
try {
|
|
7826
|
+
if (min < MIN_GRADIENT_SCALE) {
|
|
7827
|
+
const stops = this.fillRadialGradientColorStops();
|
|
7828
|
+
context.setAttr('fillStyle', stops[stops.length - 1]);
|
|
7829
|
+
}
|
|
7830
|
+
else {
|
|
7831
|
+
// The smaller scale of the transform is made 1 and the gradient shrinks
|
|
7832
|
+
// by that factor instead. It is the same ellipse, but a pixel far from
|
|
7833
|
+
// it stays close to it in gradient space: node-canvas on Linux (Cairo
|
|
7834
|
+
// fixed point) paints nothing, or breaks the context, past ~32k there.
|
|
7835
|
+
const sx = scaleX / min;
|
|
7836
|
+
const sy = scaleY / min;
|
|
7837
|
+
const { x, y } = this.fillRadialGradientEndPoint();
|
|
7838
|
+
context.transform(sx, 0, 0, sy, x - sx * x, y - sy * y);
|
|
7839
|
+
if (min !== 1) {
|
|
7840
|
+
context.setAttr('fillStyle', this.__getRadialGradient(min));
|
|
7841
|
+
}
|
|
7842
|
+
}
|
|
7843
|
+
fillPath.call(this, context);
|
|
7844
|
+
}
|
|
7845
|
+
finally {
|
|
7846
|
+
context.restore();
|
|
7847
|
+
}
|
|
7848
|
+
}
|
|
7785
7849
|
function _strokeFunc$2(context) {
|
|
7786
7850
|
context.stroke();
|
|
7787
7851
|
}
|
|
@@ -7841,6 +7905,9 @@
|
|
|
7841
7905
|
* @param {Number} [config.fillRadialGradientStartRadius]
|
|
7842
7906
|
* @param {Number} [config.fillRadialGradientEndRadius]
|
|
7843
7907
|
* @param {Array} [config.fillRadialGradientColorStops] array of color stops
|
|
7908
|
+
* @param {Object} [config.fillRadialGradientScale] object with x and y component. Scales the gradient about its end point, for an elliptical gradient
|
|
7909
|
+
* @param {Number} [config.fillRadialGradientScaleX]
|
|
7910
|
+
* @param {Number} [config.fillRadialGradientScaleY]
|
|
7844
7911
|
* @param {Boolean} [config.fillEnabled] flag which enables or disables the fill. The default value is true
|
|
7845
7912
|
* @param {String} [config.fillPriority] can be color, linear-gradient, radial-gradient, or pattern. The default value is color. The fillPriority property makes it really easy to toggle between different fill types. For example, if you want to toggle between a fill color style and a fill pattern style, simply set the fill property and the fillPattern properties, and then use setFillPriority('color') to render the shape with a color fill, or use setFillPriority('pattern') to render the shape with the pattern fill configuration
|
|
7846
7913
|
* @param {String} [config.stroke] stroke color
|
|
@@ -7962,6 +8029,29 @@
|
|
|
7962
8029
|
this.shadowOffsetX() ||
|
|
7963
8030
|
this.shadowOffsetY()));
|
|
7964
8031
|
}
|
|
8032
|
+
// The fill the shape paints with, by fillPriority, then the first one set.
|
|
8033
|
+
_getFillType(color = this.fill()) {
|
|
8034
|
+
const priority = this.fillPriority();
|
|
8035
|
+
if (color && priority === 'color')
|
|
8036
|
+
return 'color';
|
|
8037
|
+
const pattern = this.fillPatternImage();
|
|
8038
|
+
if (pattern && priority === 'pattern')
|
|
8039
|
+
return 'pattern';
|
|
8040
|
+
const linear = this.fillLinearGradientColorStops();
|
|
8041
|
+
if (linear && priority === 'linear-gradient')
|
|
8042
|
+
return 'linear-gradient';
|
|
8043
|
+
const radial = this.fillRadialGradientColorStops();
|
|
8044
|
+
if (radial && priority === 'radial-gradient')
|
|
8045
|
+
return 'radial-gradient';
|
|
8046
|
+
if (color)
|
|
8047
|
+
return 'color';
|
|
8048
|
+
if (pattern)
|
|
8049
|
+
return 'pattern';
|
|
8050
|
+
if (linear)
|
|
8051
|
+
return 'linear-gradient';
|
|
8052
|
+
if (radial)
|
|
8053
|
+
return 'radial-gradient';
|
|
8054
|
+
}
|
|
7965
8055
|
_toStyleSpace(point) {
|
|
7966
8056
|
return this._styleTransform ? this._styleTransform.point(point) : point;
|
|
7967
8057
|
}
|
|
@@ -8012,14 +8102,15 @@
|
|
|
8012
8102
|
return this.__getRadialGradient();
|
|
8013
8103
|
return this._getCache(radialGradient, this.__getRadialGradient);
|
|
8014
8104
|
}
|
|
8015
|
-
|
|
8105
|
+
// shrink scales the gradient about its end point (see _fillFunc)
|
|
8106
|
+
__getRadialGradient(shrink = 1) {
|
|
8016
8107
|
const colorStops = this.fillRadialGradientColorStops();
|
|
8017
8108
|
if (colorStops) {
|
|
8018
8109
|
const ctx = getDummyContext();
|
|
8019
8110
|
// a rigid transform keeps the radii
|
|
8020
8111
|
const start = this._toStyleSpace(this.fillRadialGradientStartPoint());
|
|
8021
8112
|
const end = this._toStyleSpace(this.fillRadialGradientEndPoint());
|
|
8022
|
-
const grd = ctx.createRadialGradient(start.x, start.y, this.fillRadialGradientStartRadius(), end.x, end.y, this.fillRadialGradientEndRadius());
|
|
8113
|
+
const grd = ctx.createRadialGradient(end.x + (start.x - end.x) * shrink, end.y + (start.y - end.y) * shrink, this.fillRadialGradientStartRadius() * shrink, end.x, end.y, this.fillRadialGradientEndRadius() * shrink);
|
|
8023
8114
|
// build color stops
|
|
8024
8115
|
for (let n = 0; n < colorStops.length; n += 2) {
|
|
8025
8116
|
grd.addColorStop(colorStops[n], colorStops[n + 1]);
|
|
@@ -8474,8 +8565,7 @@
|
|
|
8474
8565
|
}
|
|
8475
8566
|
Shape.prototype._fillFunc = _fillFunc$2;
|
|
8476
8567
|
Shape.prototype._strokeFunc = _strokeFunc$2;
|
|
8477
|
-
|
|
8478
|
-
Shape.prototype._fillFuncHit = _fillFunc$2;
|
|
8568
|
+
Shape.prototype._fillFuncHit = fillPath;
|
|
8479
8569
|
Shape.prototype._strokeFuncHit = _strokeFunc$2;
|
|
8480
8570
|
Shape.prototype._centroid = false;
|
|
8481
8571
|
Shape.prototype.nodeType = 'Shape';
|
|
@@ -8980,6 +9070,59 @@
|
|
|
8980
9070
|
* // halfway through, and then changes to green
|
|
8981
9071
|
* shape.fillRadialGradientColorStops(0, 'red', 0.5, 'blue', 1, 'green');
|
|
8982
9072
|
*/
|
|
9073
|
+
Factory.addComponentsGetterSetter(Shape, 'fillRadialGradientScale', ['x', 'y']);
|
|
9074
|
+
/**
|
|
9075
|
+
* get/set fill radial gradient scale. The whole gradient, both of its circles,
|
|
9076
|
+
* is scaled about the end point, so a scale that differs on the two axes makes
|
|
9077
|
+
* an elliptical gradient. A scale of 0 paints the last color stop. Applies to
|
|
9078
|
+
* the path a shape builds and fills with `context.fillShape()` or
|
|
9079
|
+
* `context.fillStrokeShape()`: built-in shapes and custom `sceneFunc` shapes.
|
|
9080
|
+
* Shapes with their own fill function ignore it, among them `Konva.Text` and
|
|
9081
|
+
* `Konva.TextPath`, which fill glyphs.
|
|
9082
|
+
* @name Konva.Shape#fillRadialGradientScale
|
|
9083
|
+
* @method
|
|
9084
|
+
* @param {Object} scale
|
|
9085
|
+
* @param {Number} scale.x
|
|
9086
|
+
* @param {Number} scale.y
|
|
9087
|
+
* @returns {Object}
|
|
9088
|
+
* @example
|
|
9089
|
+
* // get fill radial gradient scale
|
|
9090
|
+
* var gradientScale = shape.fillRadialGradientScale();
|
|
9091
|
+
*
|
|
9092
|
+
* // an ellipse half as tall as it is wide
|
|
9093
|
+
* shape.fillRadialGradientScale({
|
|
9094
|
+
* x: 1,
|
|
9095
|
+
* y: 0.5
|
|
9096
|
+
* });
|
|
9097
|
+
*/
|
|
9098
|
+
Factory.addGetterSetter(Shape, 'fillRadialGradientScaleX', 1, getNumberValidator());
|
|
9099
|
+
/**
|
|
9100
|
+
* get/set fill radial gradient scale x
|
|
9101
|
+
* @name Konva.Shape#fillRadialGradientScaleX
|
|
9102
|
+
* @method
|
|
9103
|
+
* @param {Number} x
|
|
9104
|
+
* @returns {Number}
|
|
9105
|
+
* @example
|
|
9106
|
+
* // get fill radial gradient scale x
|
|
9107
|
+
* var gradientScaleX = shape.fillRadialGradientScaleX();
|
|
9108
|
+
*
|
|
9109
|
+
* // set fill radial gradient scale x
|
|
9110
|
+
* shape.fillRadialGradientScaleX(2);
|
|
9111
|
+
*/
|
|
9112
|
+
Factory.addGetterSetter(Shape, 'fillRadialGradientScaleY', 1, getNumberValidator());
|
|
9113
|
+
/**
|
|
9114
|
+
* get/set fill radial gradient scale y
|
|
9115
|
+
* @name Konva.Shape#fillRadialGradientScaleY
|
|
9116
|
+
* @method
|
|
9117
|
+
* @param {Number} y
|
|
9118
|
+
* @returns {Number}
|
|
9119
|
+
* @example
|
|
9120
|
+
* // get fill radial gradient scale y
|
|
9121
|
+
* var gradientScaleY = shape.fillRadialGradientScaleY();
|
|
9122
|
+
*
|
|
9123
|
+
* // set fill radial gradient scale y
|
|
9124
|
+
* shape.fillRadialGradientScaleY(0.5);
|
|
9125
|
+
*/
|
|
8983
9126
|
Factory.addGetterSetter(Shape, 'fillPatternRepeat', 'repeat');
|
|
8984
9127
|
/**
|
|
8985
9128
|
* get/set fill pattern repeat. Can be 'repeat', 'repeat-x', 'repeat-y', or 'no-repeat'. The default is 'repeat'
|
|
@@ -11213,6 +11356,9 @@
|
|
|
11213
11356
|
* @param {Number} [config.fillRadialGradientStartRadius]
|
|
11214
11357
|
* @param {Number} [config.fillRadialGradientEndRadius]
|
|
11215
11358
|
* @param {Array} [config.fillRadialGradientColorStops] array of color stops
|
|
11359
|
+
* @param {Object} [config.fillRadialGradientScale] object with x and y component. Scales the gradient about its end point, for an elliptical gradient
|
|
11360
|
+
* @param {Number} [config.fillRadialGradientScaleX]
|
|
11361
|
+
* @param {Number} [config.fillRadialGradientScaleY]
|
|
11216
11362
|
* @param {Boolean} [config.fillEnabled] flag which enables or disables the fill. The default value is true
|
|
11217
11363
|
* @param {String} [config.fillPriority] can be color, linear-gradient, radial-gradient, or pattern. The default value is color. The fillPriority property makes it really easy to toggle between different fill types. For example, if you want to toggle between a fill color style and a fill pattern style, simply set the fill property and the fillPattern properties, and then use setFillPriority('color') to render the shape with a color fill, or use setFillPriority('pattern') to render the shape with the pattern fill configuration
|
|
11218
11364
|
* @param {String} [config.stroke] stroke color
|
|
@@ -11658,6 +11804,9 @@
|
|
|
11658
11804
|
* @param {Number} [config.fillRadialGradientStartRadius]
|
|
11659
11805
|
* @param {Number} [config.fillRadialGradientEndRadius]
|
|
11660
11806
|
* @param {Array} [config.fillRadialGradientColorStops] array of color stops
|
|
11807
|
+
* @param {Object} [config.fillRadialGradientScale] object with x and y component. Scales the gradient about its end point, for an elliptical gradient
|
|
11808
|
+
* @param {Number} [config.fillRadialGradientScaleX]
|
|
11809
|
+
* @param {Number} [config.fillRadialGradientScaleY]
|
|
11661
11810
|
* @param {Boolean} [config.fillEnabled] flag which enables or disables the fill. The default value is true
|
|
11662
11811
|
* @param {String} [config.fillPriority] can be color, linear-gradient, radial-gradient, or pattern. The default value is color. The fillPriority property makes it really easy to toggle between different fill types. For example, if you want to toggle between a fill color style and a fill pattern style, simply set the fill property and the fillPattern properties, and then use setFillPriority('color') to render the shape with a color fill, or use setFillPriority('pattern') to render the shape with the pattern fill configuration
|
|
11663
11812
|
* @param {String} [config.stroke] stroke color
|
|
@@ -11968,6 +12117,9 @@
|
|
|
11968
12117
|
* @param {Number} [config.fillRadialGradientStartRadius]
|
|
11969
12118
|
* @param {Number} [config.fillRadialGradientEndRadius]
|
|
11970
12119
|
* @param {Array} [config.fillRadialGradientColorStops] array of color stops
|
|
12120
|
+
* @param {Object} [config.fillRadialGradientScale] object with x and y component. Scales the gradient about its end point, for an elliptical gradient
|
|
12121
|
+
* @param {Number} [config.fillRadialGradientScaleX]
|
|
12122
|
+
* @param {Number} [config.fillRadialGradientScaleY]
|
|
11971
12123
|
* @param {Boolean} [config.fillEnabled] flag which enables or disables the fill. The default value is true
|
|
11972
12124
|
* @param {String} [config.fillPriority] can be color, linear-gradient, radial-gradient, or pattern. The default value is color. The fillPriority property makes it really easy to toggle between different fill types. For example, if you want to toggle between a fill color style and a fill pattern style, simply set the fill property and the fillPattern properties, and then use setFillPriority('color') to render the shape with a color fill, or use setFillPriority('pattern') to render the shape with the pattern fill configuration
|
|
11973
12125
|
* @param {String} [config.stroke] stroke color
|
|
@@ -12766,6 +12918,9 @@
|
|
|
12766
12918
|
* @param {Number} [config.fillRadialGradientStartRadius]
|
|
12767
12919
|
* @param {Number} [config.fillRadialGradientEndRadius]
|
|
12768
12920
|
* @param {Array} [config.fillRadialGradientColorStops] array of color stops
|
|
12921
|
+
* @param {Object} [config.fillRadialGradientScale] object with x and y component. Scales the gradient about its end point, for an elliptical gradient
|
|
12922
|
+
* @param {Number} [config.fillRadialGradientScaleX]
|
|
12923
|
+
* @param {Number} [config.fillRadialGradientScaleY]
|
|
12769
12924
|
* @param {Boolean} [config.fillEnabled] flag which enables or disables the fill. The default value is true
|
|
12770
12925
|
* @param {String} [config.fillPriority] can be color, linear-gradient, radial-gradient, or pattern. The default value is color. The fillPriority property makes it really easy to toggle between different fill types. For example, if you want to toggle between a fill color style and a fill pattern style, simply set the fill property and the fillPattern properties, and then use setFillPriority('color') to render the shape with a color fill, or use setFillPriority('pattern') to render the shape with the pattern fill configuration
|
|
12771
12926
|
* @param {String} [config.stroke] stroke color
|
|
@@ -13038,6 +13193,9 @@
|
|
|
13038
13193
|
* @param {Number} [config.fillRadialGradientStartRadius]
|
|
13039
13194
|
* @param {Number} [config.fillRadialGradientEndRadius]
|
|
13040
13195
|
* @param {Array} [config.fillRadialGradientColorStops] array of color stops
|
|
13196
|
+
* @param {Object} [config.fillRadialGradientScale] object with x and y component. Scales the gradient about its end point, for an elliptical gradient
|
|
13197
|
+
* @param {Number} [config.fillRadialGradientScaleX]
|
|
13198
|
+
* @param {Number} [config.fillRadialGradientScaleY]
|
|
13041
13199
|
* @param {Boolean} [config.fillEnabled] flag which enables or disables the fill. The default value is true
|
|
13042
13200
|
* @param {String} [config.fillPriority] can be color, linear-gradient, radial-gradient, or pattern. The default value is color. The fillPriority property makes it really easy to toggle between different fill types. For example, if you want to toggle between a fill color style and a fill pattern style, simply set the fill property and the fillPattern properties, and then use setFillPriority('color') to render the shape with a color fill, or use setFillPriority('pattern') to render the shape with the pattern fill configuration
|
|
13043
13201
|
* @param {String} [config.stroke] stroke color
|
|
@@ -13170,6 +13328,9 @@
|
|
|
13170
13328
|
* @param {Number} [config.fillRadialGradientStartRadius]
|
|
13171
13329
|
* @param {Number} [config.fillRadialGradientEndRadius]
|
|
13172
13330
|
* @param {Array} [config.fillRadialGradientColorStops] array of color stops
|
|
13331
|
+
* @param {Object} [config.fillRadialGradientScale] object with x and y component. Scales the gradient about its end point, for an elliptical gradient
|
|
13332
|
+
* @param {Number} [config.fillRadialGradientScaleX]
|
|
13333
|
+
* @param {Number} [config.fillRadialGradientScaleY]
|
|
13173
13334
|
* @param {Boolean} [config.fillEnabled] flag which enables or disables the fill. The default value is true
|
|
13174
13335
|
* @param {String} [config.fillPriority] can be color, linear-gradient, radial-gradient, or pattern. The default value is color. The fillPriority property makes it really easy to toggle between different fill types. For example, if you want to toggle between a fill color style and a fill pattern style, simply set the fill property and the fillPattern properties, and then use setFillPriority('color') to render the shape with a color fill, or use setFillPriority('pattern') to render the shape with the pattern fill configuration
|
|
13175
13336
|
* @param {String} [config.stroke] stroke color
|
|
@@ -13338,6 +13499,9 @@
|
|
|
13338
13499
|
* @param {Number} [config.fillRadialGradientStartRadius]
|
|
13339
13500
|
* @param {Number} [config.fillRadialGradientEndRadius]
|
|
13340
13501
|
* @param {Array} [config.fillRadialGradientColorStops] array of color stops
|
|
13502
|
+
* @param {Object} [config.fillRadialGradientScale] object with x and y component. Scales the gradient about its end point, for an elliptical gradient
|
|
13503
|
+
* @param {Number} [config.fillRadialGradientScaleX]
|
|
13504
|
+
* @param {Number} [config.fillRadialGradientScaleY]
|
|
13341
13505
|
* @param {Boolean} [config.fillEnabled] flag which enables or disables the fill. The default value is true
|
|
13342
13506
|
* @param {String} [config.fillPriority] can be color, linear-gradient, radial-gradient, or pattern. The default value is color. The fillPriority property makes it really easy to toggle between different fill types. For example, if you want to toggle between a fill color style and a fill pattern style, simply set the fill property and the fillPattern properties, and then use setFillPriority('color') to render the shape with a color fill, or use setFillPriority('pattern') to render the shape with the pattern fill configuration
|
|
13343
13507
|
* @param {String} [config.stroke] stroke color
|
|
@@ -13799,6 +13963,9 @@
|
|
|
13799
13963
|
* @param {Number} [config.fillRadialGradientStartRadius]
|
|
13800
13964
|
* @param {Number} [config.fillRadialGradientEndRadius]
|
|
13801
13965
|
* @param {Array} [config.fillRadialGradientColorStops] array of color stops
|
|
13966
|
+
* @param {Object} [config.fillRadialGradientScale] object with x and y component. Scales the gradient about its end point, for an elliptical gradient
|
|
13967
|
+
* @param {Number} [config.fillRadialGradientScaleX]
|
|
13968
|
+
* @param {Number} [config.fillRadialGradientScaleY]
|
|
13802
13969
|
* @param {Boolean} [config.fillEnabled] flag which enables or disables the fill. The default value is true
|
|
13803
13970
|
* @param {String} [config.fillPriority] can be color, linear-gradient, radial-gradient, or pattern. The default value is color. The fillPriority property makes it really easy to toggle between different fill types. For example, if you want to toggle between a fill color style and a fill pattern style, simply set the fill property and the fillPattern properties, and then use setFillPriority('color') to render the shape with a color fill, or use setFillPriority('pattern') to render the shape with the pattern fill configuration
|
|
13804
13971
|
* @param {String} [config.stroke] stroke color
|
|
@@ -14965,6 +15132,9 @@
|
|
|
14965
15132
|
* @param {Number} [config.fillRadialGradientStartRadius]
|
|
14966
15133
|
* @param {Number} [config.fillRadialGradientEndRadius]
|
|
14967
15134
|
* @param {Array} [config.fillRadialGradientColorStops] array of color stops
|
|
15135
|
+
* @param {Object} [config.fillRadialGradientScale] object with x and y component. Scales the gradient about its end point, for an elliptical gradient
|
|
15136
|
+
* @param {Number} [config.fillRadialGradientScaleX]
|
|
15137
|
+
* @param {Number} [config.fillRadialGradientScaleY]
|
|
14968
15138
|
* @param {Boolean} [config.fillEnabled] flag which enables or disables the fill. The default value is true
|
|
14969
15139
|
* @param {String} [config.fillPriority] can be color, linear-gradient, radial-gradient, or pattern. The default value is color. The fillPriority property makes it really easy to toggle between different fill types. For example, if you want to toggle between a fill color style and a fill pattern style, simply set the fill property and the fillPattern properties, and then use setFillPriority('color') to render the shape with a color fill, or use setFillPriority('pattern') to render the shape with the pattern fill configuration
|
|
14970
15140
|
* @param {String} [config.stroke] stroke color
|
|
@@ -15096,6 +15266,9 @@
|
|
|
15096
15266
|
* @param {Number} [config.fillRadialGradientStartRadius]
|
|
15097
15267
|
* @param {Number} [config.fillRadialGradientEndRadius]
|
|
15098
15268
|
* @param {Array} [config.fillRadialGradientColorStops] array of color stops
|
|
15269
|
+
* @param {Object} [config.fillRadialGradientScale] object with x and y component. Scales the gradient about its end point, for an elliptical gradient
|
|
15270
|
+
* @param {Number} [config.fillRadialGradientScaleX]
|
|
15271
|
+
* @param {Number} [config.fillRadialGradientScaleY]
|
|
15099
15272
|
* @param {Boolean} [config.fillEnabled] flag which enables or disables the fill. The default value is true
|
|
15100
15273
|
* @param {String} [config.fillPriority] can be color, linear-gradient, radial-gradient, or pattern. The default value is color. The fillPriority property makes it really easy to toggle between different fill types. For example, if you want to toggle between a fill color style and a fill pattern style, simply set the fill property and the fillPattern properties, and then use setFillPriority('color') to render the shape with a color fill, or use setFillPriority('pattern') to render the shape with the pattern fill configuration
|
|
15101
15274
|
* @param {String} [config.stroke] stroke color
|
|
@@ -15306,6 +15479,9 @@
|
|
|
15306
15479
|
* @param {Number} [config.fillRadialGradientStartRadius]
|
|
15307
15480
|
* @param {Number} [config.fillRadialGradientEndRadius]
|
|
15308
15481
|
* @param {Array} [config.fillRadialGradientColorStops] array of color stops
|
|
15482
|
+
* @param {Object} [config.fillRadialGradientScale] object with x and y component. Scales the gradient about its end point, for an elliptical gradient
|
|
15483
|
+
* @param {Number} [config.fillRadialGradientScaleX]
|
|
15484
|
+
* @param {Number} [config.fillRadialGradientScaleY]
|
|
15309
15485
|
* @param {Boolean} [config.fillEnabled] flag which enables or disables the fill. The default value is true
|
|
15310
15486
|
* @param {String} [config.fillPriority] can be color, linear-gradient, radial-gradient, or pattern. The default value is color. The fillPriority property makes it really easy to toggle between different fill types. For example, if you want to toggle between a fill color style and a fill pattern style, simply set the fill property and the fillPattern properties, and then use setFillPriority('color') to render the shape with a color fill, or use setFillPriority('pattern') to render the shape with the pattern fill configuration
|
|
15311
15487
|
* @param {String} [config.stroke] stroke color
|
|
@@ -15463,6 +15639,9 @@
|
|
|
15463
15639
|
* @param {Number} [config.fillRadialGradientStartRadius]
|
|
15464
15640
|
* @param {Number} [config.fillRadialGradientEndRadius]
|
|
15465
15641
|
* @param {Array} [config.fillRadialGradientColorStops] array of color stops
|
|
15642
|
+
* @param {Object} [config.fillRadialGradientScale] object with x and y component. Scales the gradient about its end point, for an elliptical gradient
|
|
15643
|
+
* @param {Number} [config.fillRadialGradientScaleX]
|
|
15644
|
+
* @param {Number} [config.fillRadialGradientScaleY]
|
|
15466
15645
|
* @param {Boolean} [config.fillEnabled] flag which enables or disables the fill. The default value is true
|
|
15467
15646
|
* @param {String} [config.fillPriority] can be color, linear-gradient, radial-gradient, or pattern. The default value is color. The fillPriority property makes it really easy to toggle between different fill types. For example, if you want to toggle between a fill color style and a fill pattern style, simply set the fill property and the fillPattern properties, and then use setFillPriority('color') to render the shape with a color fill, or use setFillPriority('pattern') to render the shape with the pattern fill configuration
|
|
15468
15647
|
* @param {String} [config.stroke] stroke color
|
|
@@ -15849,6 +16028,9 @@
|
|
|
15849
16028
|
* @param {Number} [config.fillRadialGradientStartRadius]
|
|
15850
16029
|
* @param {Number} [config.fillRadialGradientEndRadius]
|
|
15851
16030
|
* @param {Array} [config.fillRadialGradientColorStops] array of color stops
|
|
16031
|
+
* @param {Object} [config.fillRadialGradientScale] object with x and y component. Scales the gradient about its end point, for an elliptical gradient
|
|
16032
|
+
* @param {Number} [config.fillRadialGradientScaleX]
|
|
16033
|
+
* @param {Number} [config.fillRadialGradientScaleY]
|
|
15852
16034
|
* @param {Boolean} [config.fillEnabled] flag which enables or disables the fill. The default value is true
|
|
15853
16035
|
* @param {String} [config.fillPriority] can be color, linear-gradient, radial-gradient, or pattern. The default value is color. The fillPriority property makes it really easy to toggle between different fill types. For example, if you want to toggle between a fill color style and a fill pattern style, simply set the fill property and the fillPattern properties, and then use setFillPriority('color') to render the shape with a color fill, or use setFillPriority('pattern') to render the shape with the pattern fill configuration
|
|
15854
16036
|
* @param {String} [config.stroke] stroke color
|
|
@@ -16035,6 +16217,9 @@
|
|
|
16035
16217
|
* @param {Number} [config.fillRadialGradientStartRadius]
|
|
16036
16218
|
* @param {Number} [config.fillRadialGradientEndRadius]
|
|
16037
16219
|
* @param {Array} [config.fillRadialGradientColorStops] array of color stops
|
|
16220
|
+
* @param {Object} [config.fillRadialGradientScale] object with x and y component. Scales the gradient about its end point, for an elliptical gradient
|
|
16221
|
+
* @param {Number} [config.fillRadialGradientScaleX]
|
|
16222
|
+
* @param {Number} [config.fillRadialGradientScaleY]
|
|
16038
16223
|
* @param {Boolean} [config.fillEnabled] flag which enables or disables the fill. The default value is true
|
|
16039
16224
|
* @param {String} [config.fillPriority] can be color, linear-gradient, radial-gradient, or pattern. The default value is color. The fillPriority property makes it really easy to toggle between different fill types. For example, if you want to toggle between a fill color style and a fill pattern style, simply set the fill property and the fillPattern properties, and then use setFillPriority('color') to render the shape with a color fill, or use setFillPriority('pattern') to render the shape with the pattern fill configuration
|
|
16040
16225
|
* @param {String} [config.stroke] stroke color
|
|
@@ -18636,6 +18821,9 @@
|
|
|
18636
18821
|
* @param {Number} [config.fillRadialGradientStartRadius]
|
|
18637
18822
|
* @param {Number} [config.fillRadialGradientEndRadius]
|
|
18638
18823
|
* @param {Array} [config.fillRadialGradientColorStops] array of color stops
|
|
18824
|
+
* @param {Object} [config.fillRadialGradientScale] object with x and y component. Scales the gradient about its end point, for an elliptical gradient
|
|
18825
|
+
* @param {Number} [config.fillRadialGradientScaleX]
|
|
18826
|
+
* @param {Number} [config.fillRadialGradientScaleY]
|
|
18639
18827
|
* @param {Boolean} [config.fillEnabled] flag which enables or disables the fill. The default value is true
|
|
18640
18828
|
* @param {String} [config.fillPriority] can be color, linear-gradient, radial-gradient, or pattern. The default value is color. The fillPriority property makes it really easy to toggle between different fill types. For example, if you want to toggle between a fill color style and a fill pattern style, simply set the fill property and the fillPattern properties, and then use setFillPriority('color') to render the shape with a color fill, or use setFillPriority('pattern') to render the shape with the pattern fill configuration
|
|
18641
18829
|
* @param {String} [config.stroke] stroke color
|