@inweb/markup 26.1.1 → 26.1.3
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/dist/markup.js +432 -416
- package/dist/markup.js.map +1 -1
- package/dist/markup.min.js +1 -1
- package/dist/markup.module.js +38 -38
- package/dist/markup.module.js.map +1 -1
- package/lib/markup/IMarkup.d.ts +11 -12
- package/lib/markup/IMarkupArrow.d.ts +2 -2
- package/lib/markup/IMarkupCloud.d.ts +2 -2
- package/lib/markup/IMarkupColorable.d.ts +2 -2
- package/lib/markup/IMarkupEllipse.d.ts +2 -2
- package/lib/markup/IMarkupImage.d.ts +12 -12
- package/lib/markup/IMarkupLine.d.ts +2 -2
- package/lib/markup/IMarkupRectangle.d.ts +2 -2
- package/lib/markup/IMarkupText.d.ts +2 -2
- package/lib/markup/Konva/MarkupColor.d.ts +2 -2
- package/package.json +5 -5
- package/src/markup/IMarkup.ts +11 -12
- package/src/markup/IMarkupArrow.ts +2 -2
- package/src/markup/IMarkupCloud.ts +2 -2
- package/src/markup/IMarkupColorable.ts +2 -2
- package/src/markup/IMarkupEllipse.ts +2 -2
- package/src/markup/IMarkupImage.ts +12 -12
- package/src/markup/IMarkupLine.ts +2 -2
- package/src/markup/IMarkupRectangle.ts +2 -2
- package/src/markup/IMarkupText.ts +2 -2
- package/src/markup/Konva/MarkupColor.ts +2 -2
package/dist/markup.js
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
hasRequiredGlobal = 1;
|
|
26
26
|
(function (exports) {
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports._registerNode = exports.Konva = exports.glob =
|
|
28
|
+
exports._registerNode = exports.Konva = exports.glob = undefined;
|
|
29
29
|
const PI_OVER_180 = Math.PI / 180;
|
|
30
30
|
function detectBrowser() {
|
|
31
31
|
return (typeof window !== 'undefined' &&
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
: {};
|
|
42
42
|
exports.Konva = {
|
|
43
43
|
_global: exports.glob,
|
|
44
|
-
version: '9.3.
|
|
44
|
+
version: '9.3.18',
|
|
45
45
|
isBrowser: detectBrowser(),
|
|
46
46
|
isUnminified: /param/.test(function (param) { }.toString()),
|
|
47
47
|
dblClickWindow: 400,
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
},
|
|
74
74
|
isTransforming() {
|
|
75
75
|
var _a;
|
|
76
|
-
return (_a = exports.Konva['Transformer']) === null || _a ===
|
|
76
|
+
return (_a = exports.Konva['Transformer']) === null || _a === undefined ? undefined : _a.isTransforming();
|
|
77
77
|
},
|
|
78
78
|
isDragReady() {
|
|
79
79
|
return !!exports.Konva['DD'].node;
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
hasRequiredUtil = 1;
|
|
103
103
|
(function (exports) {
|
|
104
104
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
105
|
-
exports.Util = exports.Transform =
|
|
105
|
+
exports.Util = exports.Transform = undefined;
|
|
106
106
|
const Global_1 = requireGlobal();
|
|
107
107
|
class Transform {
|
|
108
108
|
constructor(m = [1, 0, 0, 1, 0, 0]) {
|
|
@@ -251,7 +251,7 @@
|
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
exports.Transform = Transform;
|
|
254
|
-
|
|
254
|
+
const OBJECT_ARRAY = '[object Array]', OBJECT_NUMBER = '[object Number]', OBJECT_STRING = '[object String]', OBJECT_BOOLEAN = '[object Boolean]', PI_OVER_DEG180 = Math.PI / 180, DEG180_OVER_PI = 180 / Math.PI, HASH = '#', EMPTY_STRING = '', ZERO = '0', KONVA_WARNING = 'Konva warning: ', KONVA_ERROR = 'Konva error: ', RGB_PAREN = 'rgb(', COLORS = {
|
|
255
255
|
aliceblue: [240, 248, 255],
|
|
256
256
|
antiquewhite: [250, 235, 215],
|
|
257
257
|
aqua: [0, 255, 255],
|
|
@@ -401,7 +401,8 @@
|
|
|
401
401
|
whitesmoke: [245, 245, 245],
|
|
402
402
|
yellow: [255, 255, 0],
|
|
403
403
|
yellowgreen: [154, 205, 5],
|
|
404
|
-
}, RGB_REGEX = /rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)
|
|
404
|
+
}, RGB_REGEX = /rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;
|
|
405
|
+
let animQueue = [];
|
|
405
406
|
const req = (typeof requestAnimationFrame !== 'undefined' && requestAnimationFrame) ||
|
|
406
407
|
function (f) {
|
|
407
408
|
setTimeout(f, 60);
|
|
@@ -798,19 +799,19 @@
|
|
|
798
799
|
return pc;
|
|
799
800
|
},
|
|
800
801
|
_prepareArrayForTween(startArray, endArray, isClosed) {
|
|
801
|
-
|
|
802
|
+
const start = [], end = [];
|
|
802
803
|
if (startArray.length > endArray.length) {
|
|
803
804
|
const temp = endArray;
|
|
804
805
|
endArray = startArray;
|
|
805
806
|
startArray = temp;
|
|
806
807
|
}
|
|
807
|
-
for (n = 0; n < startArray.length; n += 2) {
|
|
808
|
+
for (let n = 0; n < startArray.length; n += 2) {
|
|
808
809
|
start.push({
|
|
809
810
|
x: startArray[n],
|
|
810
811
|
y: startArray[n + 1],
|
|
811
812
|
});
|
|
812
813
|
}
|
|
813
|
-
for (n = 0; n < endArray.length; n += 2) {
|
|
814
|
+
for (let n = 0; n < endArray.length; n += 2) {
|
|
814
815
|
end.push({
|
|
815
816
|
x: endArray[n],
|
|
816
817
|
y: endArray[n + 1],
|
|
@@ -979,8 +980,8 @@
|
|
|
979
980
|
function getNumberOrArrayOfNumbersValidator(noOfElements) {
|
|
980
981
|
if (Global_1.Konva.isUnminified) {
|
|
981
982
|
return function (val, attr) {
|
|
982
|
-
|
|
983
|
-
|
|
983
|
+
let isNumber = Util_1.Util._isNumber(val);
|
|
984
|
+
let isValidArray = Util_1.Util._isArray(val) && val.length == noOfElements;
|
|
984
985
|
if (!isNumber && !isValidArray) {
|
|
985
986
|
Util_1.Util.warn(_formatValue(val) +
|
|
986
987
|
' is a not valid value for "' +
|
|
@@ -996,8 +997,8 @@
|
|
|
996
997
|
function getNumberOrAutoValidator() {
|
|
997
998
|
if (Global_1.Konva.isUnminified) {
|
|
998
999
|
return function (val, attr) {
|
|
999
|
-
|
|
1000
|
-
|
|
1000
|
+
var isNumber = Util_1.Util._isNumber(val);
|
|
1001
|
+
var isAuto = val === 'auto';
|
|
1001
1002
|
if (!(isNumber || isAuto)) {
|
|
1002
1003
|
Util_1.Util.warn(_formatValue(val) +
|
|
1003
1004
|
' is a not valid value for "' +
|
|
@@ -1026,7 +1027,7 @@
|
|
|
1026
1027
|
return function (val, attr) {
|
|
1027
1028
|
const isString = Util_1.Util._isString(val);
|
|
1028
1029
|
const isGradient = Object.prototype.toString.call(val) === '[object CanvasGradient]' ||
|
|
1029
|
-
(val && val
|
|
1030
|
+
(val && val['addColorStop']);
|
|
1030
1031
|
if (!(isString || isGradient)) {
|
|
1031
1032
|
Util_1.Util.warn(_formatValue(val) +
|
|
1032
1033
|
' is a not valid value for "' +
|
|
@@ -1081,7 +1082,7 @@
|
|
|
1081
1082
|
function getBooleanValidator() {
|
|
1082
1083
|
if (Global_1.Konva.isUnminified) {
|
|
1083
1084
|
return function (val, attr) {
|
|
1084
|
-
|
|
1085
|
+
var isBool = val === true || val === false;
|
|
1085
1086
|
if (!isBool) {
|
|
1086
1087
|
Util_1.Util.warn(_formatValue(val) +
|
|
1087
1088
|
' is a not valid value for "' +
|
|
@@ -1119,10 +1120,11 @@
|
|
|
1119
1120
|
hasRequiredFactory = 1;
|
|
1120
1121
|
(function (exports) {
|
|
1121
1122
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1122
|
-
exports.Factory =
|
|
1123
|
+
exports.Factory = undefined;
|
|
1123
1124
|
const Util_1 = requireUtil();
|
|
1124
1125
|
const Validators_1 = requireValidators();
|
|
1125
|
-
const GET = 'get'
|
|
1126
|
+
const GET = 'get';
|
|
1127
|
+
const SET = 'set';
|
|
1126
1128
|
exports.Factory = {
|
|
1127
1129
|
addGetterSetter(constructor, attr, def, validator, after) {
|
|
1128
1130
|
exports.Factory.addGetter(constructor, attr, def);
|
|
@@ -1130,7 +1132,7 @@
|
|
|
1130
1132
|
exports.Factory.addOverloadedGetterSetter(constructor, attr);
|
|
1131
1133
|
},
|
|
1132
1134
|
addGetter(constructor, attr, def) {
|
|
1133
|
-
|
|
1135
|
+
var method = GET + Util_1.Util._capitalize(attr);
|
|
1134
1136
|
constructor.prototype[method] =
|
|
1135
1137
|
constructor.prototype[method] ||
|
|
1136
1138
|
function () {
|
|
@@ -1139,13 +1141,13 @@
|
|
|
1139
1141
|
};
|
|
1140
1142
|
},
|
|
1141
1143
|
addSetter(constructor, attr, validator, after) {
|
|
1142
|
-
|
|
1144
|
+
var method = SET + Util_1.Util._capitalize(attr);
|
|
1143
1145
|
if (!constructor.prototype[method]) {
|
|
1144
1146
|
exports.Factory.overWriteSetter(constructor, attr, validator, after);
|
|
1145
1147
|
}
|
|
1146
1148
|
},
|
|
1147
1149
|
overWriteSetter(constructor, attr, validator, after) {
|
|
1148
|
-
|
|
1150
|
+
var method = SET + Util_1.Util._capitalize(attr);
|
|
1149
1151
|
constructor.prototype[method] = function (val) {
|
|
1150
1152
|
if (validator && val !== undefined && val !== null) {
|
|
1151
1153
|
val = validator.call(this, val, attr);
|
|
@@ -1158,25 +1160,25 @@
|
|
|
1158
1160
|
};
|
|
1159
1161
|
},
|
|
1160
1162
|
addComponentsGetterSetter(constructor, attr, components, validator, after) {
|
|
1161
|
-
|
|
1163
|
+
const len = components.length, capitalize = Util_1.Util._capitalize, getter = GET + capitalize(attr), setter = SET + capitalize(attr);
|
|
1162
1164
|
constructor.prototype[getter] = function () {
|
|
1163
1165
|
const ret = {};
|
|
1164
|
-
for (n = 0; n < len; n++) {
|
|
1165
|
-
component = components[n];
|
|
1166
|
+
for (let n = 0; n < len; n++) {
|
|
1167
|
+
const component = components[n];
|
|
1166
1168
|
ret[component] = this.getAttr(attr + capitalize(component));
|
|
1167
1169
|
}
|
|
1168
1170
|
return ret;
|
|
1169
1171
|
};
|
|
1170
1172
|
const basicValidator = (0, Validators_1.getComponentValidator)(components);
|
|
1171
1173
|
constructor.prototype[setter] = function (val) {
|
|
1172
|
-
|
|
1174
|
+
const oldVal = this.attrs[attr];
|
|
1173
1175
|
if (validator) {
|
|
1174
|
-
val = validator.call(this, val);
|
|
1176
|
+
val = validator.call(this, val, attr);
|
|
1175
1177
|
}
|
|
1176
1178
|
if (basicValidator) {
|
|
1177
1179
|
basicValidator.call(this, val, attr);
|
|
1178
1180
|
}
|
|
1179
|
-
for (key in val) {
|
|
1181
|
+
for (const key in val) {
|
|
1180
1182
|
if (!val.hasOwnProperty(key)) {
|
|
1181
1183
|
continue;
|
|
1182
1184
|
}
|
|
@@ -1196,7 +1198,7 @@
|
|
|
1196
1198
|
exports.Factory.addOverloadedGetterSetter(constructor, attr);
|
|
1197
1199
|
},
|
|
1198
1200
|
addOverloadedGetterSetter(constructor, attr) {
|
|
1199
|
-
|
|
1201
|
+
var capitalizedAttr = Util_1.Util._capitalize(attr), setter = SET + capitalizedAttr, getter = GET + capitalizedAttr;
|
|
1200
1202
|
constructor.prototype[attr] = function () {
|
|
1201
1203
|
if (arguments.length) {
|
|
1202
1204
|
this[setter](arguments[0]);
|
|
@@ -1256,13 +1258,13 @@
|
|
|
1256
1258
|
if (hasRequiredContext) return Context;
|
|
1257
1259
|
hasRequiredContext = 1;
|
|
1258
1260
|
Object.defineProperty(Context, "__esModule", { value: true });
|
|
1259
|
-
Context.HitContext = Context.SceneContext = Context.Context =
|
|
1261
|
+
Context.HitContext = Context.SceneContext = Context.Context = undefined;
|
|
1260
1262
|
const Util_1 = requireUtil();
|
|
1261
1263
|
const Global_1 = requireGlobal();
|
|
1262
1264
|
function simplifyArray(arr) {
|
|
1263
|
-
|
|
1264
|
-
for (n = 0; n < len; n++) {
|
|
1265
|
-
val = arr[n];
|
|
1265
|
+
const retArr = [], len = arr.length, util = Util_1.Util;
|
|
1266
|
+
for (let n = 0; n < len; n++) {
|
|
1267
|
+
let val = arr[n];
|
|
1266
1268
|
if (util._isNumber(val)) {
|
|
1267
1269
|
val = Math.round(val * 1000) / 1000;
|
|
1268
1270
|
}
|
|
@@ -1745,7 +1747,7 @@
|
|
|
1745
1747
|
}
|
|
1746
1748
|
_applyShadow(shape) {
|
|
1747
1749
|
var _a, _b, _c;
|
|
1748
|
-
const color = (_a = shape.getShadowRGBA()) !== null && _a !==
|
|
1750
|
+
const color = (_a = shape.getShadowRGBA()) !== null && _a !== undefined ? _a : 'black', blur = (_b = shape.getShadowBlur()) !== null && _b !== undefined ? _b : 5, offset = (_c = shape.getShadowOffset()) !== null && _c !== undefined ? _c : {
|
|
1749
1751
|
x: 0,
|
|
1750
1752
|
y: 0,
|
|
1751
1753
|
}, scale = shape.getAbsoluteScale(), ratio = this.canvas.getPixelRatio(), scaleX = scale.x * ratio, scaleY = scale.y * ratio;
|
|
@@ -1804,7 +1806,7 @@
|
|
|
1804
1806
|
if (hasRequiredCanvas) return Canvas;
|
|
1805
1807
|
hasRequiredCanvas = 1;
|
|
1806
1808
|
Object.defineProperty(Canvas, "__esModule", { value: true });
|
|
1807
|
-
Canvas.HitCanvas = Canvas.SceneCanvas = Canvas.Canvas =
|
|
1809
|
+
Canvas.HitCanvas = Canvas.SceneCanvas = Canvas.Canvas = undefined;
|
|
1808
1810
|
const Util_1 = requireUtil();
|
|
1809
1811
|
const Context_1 = requireContext();
|
|
1810
1812
|
const Global_1 = requireGlobal();
|
|
@@ -1930,7 +1932,7 @@
|
|
|
1930
1932
|
hasRequiredDragAndDrop = 1;
|
|
1931
1933
|
(function (exports) {
|
|
1932
1934
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1933
|
-
exports.DD =
|
|
1935
|
+
exports.DD = undefined;
|
|
1934
1936
|
const Global_1 = requireGlobal();
|
|
1935
1937
|
const Util_1 = requireUtil();
|
|
1936
1938
|
exports.DD = {
|
|
@@ -2051,7 +2053,7 @@
|
|
|
2051
2053
|
if (hasRequiredNode) return Node;
|
|
2052
2054
|
hasRequiredNode = 1;
|
|
2053
2055
|
Object.defineProperty(Node, "__esModule", { value: true });
|
|
2054
|
-
Node.Node =
|
|
2056
|
+
Node.Node = undefined;
|
|
2055
2057
|
const Util_1 = requireUtil();
|
|
2056
2058
|
const Factory_1 = requireFactory();
|
|
2057
2059
|
const Canvas_1 = requireCanvas();
|
|
@@ -2956,7 +2958,7 @@
|
|
|
2956
2958
|
var _a, _b;
|
|
2957
2959
|
const m = this._cache.get(TRANSFORM) || new Util_1.Transform();
|
|
2958
2960
|
m.reset();
|
|
2959
|
-
const x = this.x(), y = this.y(), rotation = Global_1.Konva.getAngle(this.rotation()), scaleX = (_a = this.attrs.scaleX) !== null && _a !==
|
|
2961
|
+
const x = this.x(), y = this.y(), rotation = Global_1.Konva.getAngle(this.rotation()), scaleX = (_a = this.attrs.scaleX) !== null && _a !== undefined ? _a : 1, scaleY = (_b = this.attrs.scaleY) !== null && _b !== undefined ? _b : 1, skewX = this.attrs.skewX || 0, skewY = this.attrs.skewY || 0, offsetX = this.attrs.offsetX || 0, offsetY = this.attrs.offsetY || 0;
|
|
2960
2962
|
if (x !== 0 || y !== 0) {
|
|
2961
2963
|
m.translate(x, y);
|
|
2962
2964
|
}
|
|
@@ -3158,7 +3160,7 @@
|
|
|
3158
3160
|
_requestDraw() {
|
|
3159
3161
|
if (Global_1.Konva.autoDrawEnabled) {
|
|
3160
3162
|
const drawNode = this.getLayer() || this.getStage();
|
|
3161
|
-
drawNode === null || drawNode ===
|
|
3163
|
+
drawNode === null || drawNode === undefined ? undefined : drawNode.batchDraw();
|
|
3162
3164
|
}
|
|
3163
3165
|
}
|
|
3164
3166
|
_setAttr(key, val) {
|
|
@@ -3219,13 +3221,13 @@
|
|
|
3219
3221
|
}
|
|
3220
3222
|
_getProtoListeners(eventType) {
|
|
3221
3223
|
var _a, _b, _c;
|
|
3222
|
-
const allListeners = (_a = this._cache.get(ALL_LISTENERS)) !== null && _a !==
|
|
3223
|
-
let events = allListeners === null || allListeners ===
|
|
3224
|
+
const allListeners = (_a = this._cache.get(ALL_LISTENERS)) !== null && _a !== undefined ? _a : {};
|
|
3225
|
+
let events = allListeners === null || allListeners === undefined ? undefined : allListeners[eventType];
|
|
3224
3226
|
if (events === undefined) {
|
|
3225
3227
|
events = [];
|
|
3226
3228
|
let obj = Object.getPrototypeOf(this);
|
|
3227
3229
|
while (obj) {
|
|
3228
|
-
const hierarchyEvents = (_c = (_b = obj.eventListeners) === null || _b ===
|
|
3230
|
+
const hierarchyEvents = (_c = (_b = obj.eventListeners) === null || _b === undefined ? undefined : _b[eventType]) !== null && _c !== undefined ? _c : [];
|
|
3229
3231
|
events.push(...hierarchyEvents);
|
|
3230
3232
|
obj = Object.getPrototypeOf(obj);
|
|
3231
3233
|
}
|
|
@@ -3461,12 +3463,12 @@
|
|
|
3461
3463
|
Factory_1.Factory.addComponentsGetterSetter(Node$1, 'offset', ['x', 'y']);
|
|
3462
3464
|
addGetterSetter(Node$1, 'offsetX', 0, (0, Validators_1.getNumberValidator)());
|
|
3463
3465
|
addGetterSetter(Node$1, 'offsetY', 0, (0, Validators_1.getNumberValidator)());
|
|
3464
|
-
addGetterSetter(Node$1, 'dragDistance',
|
|
3466
|
+
addGetterSetter(Node$1, 'dragDistance', undefined, (0, Validators_1.getNumberValidator)());
|
|
3465
3467
|
addGetterSetter(Node$1, 'width', 0, (0, Validators_1.getNumberValidator)());
|
|
3466
3468
|
addGetterSetter(Node$1, 'height', 0, (0, Validators_1.getNumberValidator)());
|
|
3467
3469
|
addGetterSetter(Node$1, 'listening', true, (0, Validators_1.getBooleanValidator)());
|
|
3468
3470
|
addGetterSetter(Node$1, 'preventDefault', true, (0, Validators_1.getBooleanValidator)());
|
|
3469
|
-
addGetterSetter(Node$1, 'filters',
|
|
3471
|
+
addGetterSetter(Node$1, 'filters', undefined, function (val) {
|
|
3470
3472
|
this._filterUpToDate = false;
|
|
3471
3473
|
return val;
|
|
3472
3474
|
});
|
|
@@ -3491,7 +3493,7 @@
|
|
|
3491
3493
|
if (hasRequiredContainer) return Container;
|
|
3492
3494
|
hasRequiredContainer = 1;
|
|
3493
3495
|
Object.defineProperty(Container, "__esModule", { value: true });
|
|
3494
|
-
Container.Container =
|
|
3496
|
+
Container.Container = undefined;
|
|
3495
3497
|
const Factory_1 = requireFactory();
|
|
3496
3498
|
const Node_1 = requireNode();
|
|
3497
3499
|
const Validators_1 = requireValidators();
|
|
@@ -3648,13 +3650,13 @@
|
|
|
3648
3650
|
if (this.isCached()) {
|
|
3649
3651
|
return;
|
|
3650
3652
|
}
|
|
3651
|
-
(_a = this.children) === null || _a ===
|
|
3653
|
+
(_a = this.children) === null || _a === undefined ? undefined : _a.forEach(function (node) {
|
|
3652
3654
|
node._clearSelfAndDescendantCache(attr);
|
|
3653
3655
|
});
|
|
3654
3656
|
}
|
|
3655
3657
|
_setChildrenIndices() {
|
|
3656
3658
|
var _a;
|
|
3657
|
-
(_a = this.children) === null || _a ===
|
|
3659
|
+
(_a = this.children) === null || _a === undefined ? undefined : _a.forEach(function (child, n) {
|
|
3658
3660
|
child.index = n;
|
|
3659
3661
|
});
|
|
3660
3662
|
this._requestDraw();
|
|
@@ -3725,7 +3727,7 @@
|
|
|
3725
3727
|
context.save();
|
|
3726
3728
|
context._applyGlobalCompositeOperation(this);
|
|
3727
3729
|
}
|
|
3728
|
-
(_a = this.children) === null || _a ===
|
|
3730
|
+
(_a = this.children) === null || _a === undefined ? undefined : _a.forEach(function (child) {
|
|
3729
3731
|
child[drawMethod](canvas, top, bufferCanvas);
|
|
3730
3732
|
});
|
|
3731
3733
|
if (hasComposition) {
|
|
@@ -3747,7 +3749,7 @@
|
|
|
3747
3749
|
height: 0,
|
|
3748
3750
|
};
|
|
3749
3751
|
const that = this;
|
|
3750
|
-
(_a = this.children) === null || _a ===
|
|
3752
|
+
(_a = this.children) === null || _a === undefined ? undefined : _a.forEach(function (child) {
|
|
3751
3753
|
if (!child.visible()) {
|
|
3752
3754
|
return;
|
|
3753
3755
|
}
|
|
@@ -3879,7 +3881,7 @@
|
|
|
3879
3881
|
hasRequiredStage = 1;
|
|
3880
3882
|
(function (exports) {
|
|
3881
3883
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3882
|
-
exports.Stage = exports.stages =
|
|
3884
|
+
exports.Stage = exports.stages = undefined;
|
|
3883
3885
|
const Util_1 = requireUtil();
|
|
3884
3886
|
const Factory_1 = requireFactory();
|
|
3885
3887
|
const Container_1 = requireContainer();
|
|
@@ -4037,8 +4039,8 @@
|
|
|
4037
4039
|
return true;
|
|
4038
4040
|
}
|
|
4039
4041
|
clear() {
|
|
4040
|
-
|
|
4041
|
-
for (n = 0; n < len; n++) {
|
|
4042
|
+
const layers = this.children, len = layers.length;
|
|
4043
|
+
for (let n = 0; n < len; n++) {
|
|
4042
4044
|
layers[n].clear();
|
|
4043
4045
|
}
|
|
4044
4046
|
return this;
|
|
@@ -4116,8 +4118,8 @@
|
|
|
4116
4118
|
if (!pos) {
|
|
4117
4119
|
return null;
|
|
4118
4120
|
}
|
|
4119
|
-
|
|
4120
|
-
for (n = end; n >= 0; n--) {
|
|
4121
|
+
const layers = this.children, len = layers.length, end = len - 1;
|
|
4122
|
+
for (let n = end; n >= 0; n--) {
|
|
4121
4123
|
const shape = layers[n].getIntersection(pos);
|
|
4122
4124
|
if (shape) {
|
|
4123
4125
|
return shape;
|
|
@@ -4430,7 +4432,7 @@
|
|
|
4430
4432
|
});
|
|
4431
4433
|
}
|
|
4432
4434
|
Global_1.Konva['_' + eventType + 'ListenClick'] = false;
|
|
4433
|
-
if (evt.cancelable && eventType !== 'touch') {
|
|
4435
|
+
if (evt.cancelable && eventType !== 'touch' && eventType !== 'pointer') {
|
|
4434
4436
|
evt.preventDefault();
|
|
4435
4437
|
}
|
|
4436
4438
|
}
|
|
@@ -4475,7 +4477,8 @@
|
|
|
4475
4477
|
PointerEvents.releaseCapture(evt.pointerId);
|
|
4476
4478
|
}
|
|
4477
4479
|
setPointersPositions(evt) {
|
|
4478
|
-
|
|
4480
|
+
const contentPosition = this._getContentPosition();
|
|
4481
|
+
let x = null, y = null;
|
|
4479
4482
|
evt = evt ? evt : window.event;
|
|
4480
4483
|
if (evt.touches !== undefined) {
|
|
4481
4484
|
this._pointerPositions = [];
|
|
@@ -4595,7 +4598,7 @@
|
|
|
4595
4598
|
hasRequiredShape = 1;
|
|
4596
4599
|
(function (exports) {
|
|
4597
4600
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4598
|
-
exports.Shape = exports.shapes =
|
|
4601
|
+
exports.Shape = exports.shapes = undefined;
|
|
4599
4602
|
const Global_1 = requireGlobal();
|
|
4600
4603
|
const Util_1 = requireUtil();
|
|
4601
4604
|
const Factory_1 = requireFactory();
|
|
@@ -4828,7 +4831,7 @@
|
|
|
4828
4831
|
}
|
|
4829
4832
|
_useBufferCanvas(forceFill) {
|
|
4830
4833
|
var _a;
|
|
4831
|
-
const perfectDrawEnabled = (_a = this.attrs.perfectDrawEnabled) !== null && _a !==
|
|
4834
|
+
const perfectDrawEnabled = (_a = this.attrs.perfectDrawEnabled) !== null && _a !== undefined ? _a : true;
|
|
4832
4835
|
if (!perfectDrawEnabled) {
|
|
4833
4836
|
return false;
|
|
4834
4837
|
}
|
|
@@ -4997,16 +5000,16 @@
|
|
|
4997
5000
|
return this;
|
|
4998
5001
|
}
|
|
4999
5002
|
drawHitFromCache(alphaThreshold = 0) {
|
|
5000
|
-
|
|
5003
|
+
const cachedCanvas = this._getCanvasCache(), sceneCanvas = this._getCachedSceneCanvas(), hitCanvas = cachedCanvas.hit, hitContext = hitCanvas.getContext(), hitWidth = hitCanvas.getWidth(), hitHeight = hitCanvas.getHeight();
|
|
5001
5004
|
hitContext.clear();
|
|
5002
5005
|
hitContext.drawImage(sceneCanvas._canvas, 0, 0, hitWidth, hitHeight);
|
|
5003
5006
|
try {
|
|
5004
|
-
hitImageData = hitContext.getImageData(0, 0, hitWidth, hitHeight);
|
|
5005
|
-
hitData = hitImageData.data;
|
|
5006
|
-
len = hitData.length;
|
|
5007
|
-
rgbColorKey = Util_1.Util._hexToRgb(this.colorKey);
|
|
5008
|
-
for (i = 0; i < len; i += 4) {
|
|
5009
|
-
alpha = hitData[i + 3];
|
|
5007
|
+
const hitImageData = hitContext.getImageData(0, 0, hitWidth, hitHeight);
|
|
5008
|
+
const hitData = hitImageData.data;
|
|
5009
|
+
const len = hitData.length;
|
|
5010
|
+
const rgbColorKey = Util_1.Util._hexToRgb(this.colorKey);
|
|
5011
|
+
for (let i = 0; i < len; i += 4) {
|
|
5012
|
+
const alpha = hitData[i + 3];
|
|
5010
5013
|
if (alpha > alphaThreshold) {
|
|
5011
5014
|
hitData[i] = rgbColorKey.r;
|
|
5012
5015
|
hitData[i + 1] = rgbColorKey.g;
|
|
@@ -5148,7 +5151,7 @@
|
|
|
5148
5151
|
if (hasRequiredLayer) return Layer;
|
|
5149
5152
|
hasRequiredLayer = 1;
|
|
5150
5153
|
Object.defineProperty(Layer, "__esModule", { value: true });
|
|
5151
|
-
Layer.Layer =
|
|
5154
|
+
Layer.Layer = undefined;
|
|
5152
5155
|
const Util_1 = requireUtil();
|
|
5153
5156
|
const Container_1 = requireContainer();
|
|
5154
5157
|
const Node_1 = requireNode();
|
|
@@ -5466,7 +5469,7 @@
|
|
|
5466
5469
|
if (hasRequiredFastLayer) return FastLayer;
|
|
5467
5470
|
hasRequiredFastLayer = 1;
|
|
5468
5471
|
Object.defineProperty(FastLayer, "__esModule", { value: true });
|
|
5469
|
-
FastLayer.FastLayer =
|
|
5472
|
+
FastLayer.FastLayer = undefined;
|
|
5470
5473
|
const Util_1 = requireUtil();
|
|
5471
5474
|
const Layer_1 = requireLayer();
|
|
5472
5475
|
const Global_1 = requireGlobal();
|
|
@@ -5491,7 +5494,7 @@
|
|
|
5491
5494
|
if (hasRequiredGroup) return Group;
|
|
5492
5495
|
hasRequiredGroup = 1;
|
|
5493
5496
|
Object.defineProperty(Group, "__esModule", { value: true });
|
|
5494
|
-
Group.Group =
|
|
5497
|
+
Group.Group = undefined;
|
|
5495
5498
|
const Util_1 = requireUtil();
|
|
5496
5499
|
const Container_1 = requireContainer();
|
|
5497
5500
|
const Global_1 = requireGlobal();
|
|
@@ -5517,7 +5520,7 @@
|
|
|
5517
5520
|
if (hasRequiredAnimation) return Animation;
|
|
5518
5521
|
hasRequiredAnimation = 1;
|
|
5519
5522
|
Object.defineProperty(Animation, "__esModule", { value: true });
|
|
5520
|
-
Animation.Animation =
|
|
5523
|
+
Animation.Animation = undefined;
|
|
5521
5524
|
const Global_1 = requireGlobal();
|
|
5522
5525
|
const Util_1 = requireUtil();
|
|
5523
5526
|
const now = (function () {
|
|
@@ -5673,18 +5676,19 @@
|
|
|
5673
5676
|
hasRequiredTween = 1;
|
|
5674
5677
|
(function (exports) {
|
|
5675
5678
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5676
|
-
exports.Easings = exports.Tween =
|
|
5679
|
+
exports.Easings = exports.Tween = undefined;
|
|
5677
5680
|
const Util_1 = requireUtil();
|
|
5678
5681
|
const Animation_1 = requireAnimation();
|
|
5679
5682
|
const Node_1 = requireNode();
|
|
5680
5683
|
const Global_1 = requireGlobal();
|
|
5681
|
-
|
|
5684
|
+
const blacklist = {
|
|
5682
5685
|
node: 1,
|
|
5683
5686
|
duration: 1,
|
|
5684
5687
|
easing: 1,
|
|
5685
5688
|
onFinish: 1,
|
|
5686
5689
|
yoyo: 1,
|
|
5687
|
-
}, PAUSED = 1, PLAYING = 2, REVERSING = 3,
|
|
5690
|
+
}, PAUSED = 1, PLAYING = 2, REVERSING = 3, colorAttrs = ['fill', 'stroke', 'shadowColor'];
|
|
5691
|
+
let idCounter = 0;
|
|
5688
5692
|
class TweenEngine {
|
|
5689
5693
|
constructor(prop, propFunc, func, begin, finish, duration, yoyo) {
|
|
5690
5694
|
this.prop = prop;
|
|
@@ -5801,7 +5805,8 @@
|
|
|
5801
5805
|
}
|
|
5802
5806
|
class Tween {
|
|
5803
5807
|
constructor(config) {
|
|
5804
|
-
|
|
5808
|
+
const that = this, node = config.node, nodeId = node._id, easing = config.easing || exports.Easings.Linear, yoyo = !!config.yoyo;
|
|
5809
|
+
let duration, key;
|
|
5805
5810
|
if (typeof config.duration === 'undefined') {
|
|
5806
5811
|
duration = 0.3;
|
|
5807
5812
|
}
|
|
@@ -5845,12 +5850,13 @@
|
|
|
5845
5850
|
this.onUpdate = config.onUpdate;
|
|
5846
5851
|
}
|
|
5847
5852
|
_addAttr(key, end) {
|
|
5848
|
-
|
|
5849
|
-
|
|
5853
|
+
const node = this.node, nodeId = node._id;
|
|
5854
|
+
let diff, len, trueEnd, trueStart, endRGBA;
|
|
5855
|
+
const tweenId = Tween.tweens[nodeId][key];
|
|
5850
5856
|
if (tweenId) {
|
|
5851
5857
|
delete Tween.attrs[nodeId][tweenId][key];
|
|
5852
5858
|
}
|
|
5853
|
-
start = node.getAttr(key);
|
|
5859
|
+
let start = node.getAttr(key);
|
|
5854
5860
|
if (Util_1.Util._isArray(end)) {
|
|
5855
5861
|
diff = [];
|
|
5856
5862
|
len = Math.max(end.length, start.length);
|
|
@@ -5865,7 +5871,7 @@
|
|
|
5865
5871
|
}
|
|
5866
5872
|
}
|
|
5867
5873
|
if (key.indexOf('fill') === 0) {
|
|
5868
|
-
for (n = 0; n < len; n++) {
|
|
5874
|
+
for (let n = 0; n < len; n++) {
|
|
5869
5875
|
if (n % 2 === 0) {
|
|
5870
5876
|
diff.push(end[n] - start[n]);
|
|
5871
5877
|
}
|
|
@@ -5883,7 +5889,7 @@
|
|
|
5883
5889
|
}
|
|
5884
5890
|
}
|
|
5885
5891
|
else {
|
|
5886
|
-
for (n = 0; n < len; n++) {
|
|
5892
|
+
for (let n = 0; n < len; n++) {
|
|
5887
5893
|
diff.push(end[n] - start[n]);
|
|
5888
5894
|
}
|
|
5889
5895
|
}
|
|
@@ -5911,7 +5917,8 @@
|
|
|
5911
5917
|
Tween.tweens[nodeId][key] = this._id;
|
|
5912
5918
|
}
|
|
5913
5919
|
_tweenFunc(i) {
|
|
5914
|
-
|
|
5920
|
+
const node = this.node, attrs = Tween.attrs[node._id][this._id];
|
|
5921
|
+
let key, attr, start, diff, newVal, n, len, end;
|
|
5915
5922
|
for (key in attrs) {
|
|
5916
5923
|
attr = attrs[key];
|
|
5917
5924
|
start = attr.start;
|
|
@@ -6023,9 +6030,9 @@
|
|
|
6023
6030
|
return this;
|
|
6024
6031
|
}
|
|
6025
6032
|
destroy() {
|
|
6026
|
-
|
|
6033
|
+
const nodeId = this.node._id, thisId = this._id, attrs = Tween.tweens[nodeId];
|
|
6027
6034
|
this.pause();
|
|
6028
|
-
for (key in attrs) {
|
|
6035
|
+
for (const key in attrs) {
|
|
6029
6036
|
delete Tween.tweens[nodeId][key];
|
|
6030
6037
|
}
|
|
6031
6038
|
delete Tween.attrs[nodeId][thisId];
|
|
@@ -6202,7 +6209,7 @@
|
|
|
6202
6209
|
hasRequired_CoreInternals = 1;
|
|
6203
6210
|
(function (exports) {
|
|
6204
6211
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6205
|
-
exports.Konva =
|
|
6212
|
+
exports.Konva = undefined;
|
|
6206
6213
|
const Global_1 = requireGlobal();
|
|
6207
6214
|
const Util_1 = requireUtil();
|
|
6208
6215
|
const Node_1 = requireNode();
|
|
@@ -6249,7 +6256,7 @@
|
|
|
6249
6256
|
if (hasRequiredArc) return Arc;
|
|
6250
6257
|
hasRequiredArc = 1;
|
|
6251
6258
|
Object.defineProperty(Arc, "__esModule", { value: true });
|
|
6252
|
-
Arc.Arc =
|
|
6259
|
+
Arc.Arc = undefined;
|
|
6253
6260
|
const Factory_1 = requireFactory();
|
|
6254
6261
|
const Shape_1 = requireShape();
|
|
6255
6262
|
const Global_1 = requireGlobal();
|
|
@@ -6319,7 +6326,7 @@
|
|
|
6319
6326
|
if (hasRequiredLine) return Line;
|
|
6320
6327
|
hasRequiredLine = 1;
|
|
6321
6328
|
Object.defineProperty(Line, "__esModule", { value: true });
|
|
6322
|
-
Line.Line =
|
|
6329
|
+
Line.Line = undefined;
|
|
6323
6330
|
const Factory_1 = requireFactory();
|
|
6324
6331
|
const Global_1 = requireGlobal();
|
|
6325
6332
|
const Shape_1 = requireShape();
|
|
@@ -6490,342 +6497,342 @@
|
|
|
6490
6497
|
hasRequiredBezierFunctions = 1;
|
|
6491
6498
|
(function (exports) {
|
|
6492
6499
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6493
|
-
exports.t2length = exports.getQuadraticArcLength = exports.getCubicArcLength = exports.binomialCoefficients = exports.cValues = exports.tValues =
|
|
6500
|
+
exports.t2length = exports.getQuadraticArcLength = exports.getCubicArcLength = exports.binomialCoefficients = exports.cValues = exports.tValues = undefined;
|
|
6494
6501
|
exports.tValues = [
|
|
6495
6502
|
[],
|
|
6496
6503
|
[],
|
|
6497
6504
|
[
|
|
6498
|
-
-0.
|
|
6505
|
+
-0.5773502691896257,
|
|
6499
6506
|
0.5773502691896257645091487805019574556476,
|
|
6500
6507
|
],
|
|
6501
6508
|
[
|
|
6502
|
-
0, -0.
|
|
6509
|
+
0, -0.7745966692414834,
|
|
6503
6510
|
0.7745966692414833770358530799564799221665,
|
|
6504
6511
|
],
|
|
6505
6512
|
[
|
|
6506
|
-
-0.
|
|
6513
|
+
-0.33998104358485626,
|
|
6507
6514
|
0.3399810435848562648026657591032446872005,
|
|
6508
|
-
-0.
|
|
6515
|
+
-0.8611363115940526,
|
|
6509
6516
|
0.8611363115940525752239464888928095050957,
|
|
6510
6517
|
],
|
|
6511
6518
|
[
|
|
6512
|
-
0, -0.
|
|
6519
|
+
0, -0.5384693101056831,
|
|
6513
6520
|
0.5384693101056830910363144207002088049672,
|
|
6514
|
-
-0.
|
|
6521
|
+
-0.906179845938664,
|
|
6515
6522
|
0.9061798459386639927976268782993929651256,
|
|
6516
6523
|
],
|
|
6517
6524
|
[
|
|
6518
6525
|
0.6612093864662645136613995950199053470064,
|
|
6519
|
-
-0.
|
|
6520
|
-
-0.
|
|
6526
|
+
-0.6612093864662645,
|
|
6527
|
+
-0.2386191860831969,
|
|
6521
6528
|
0.2386191860831969086305017216807119354186,
|
|
6522
|
-
-0.
|
|
6529
|
+
-0.932469514203152,
|
|
6523
6530
|
0.9324695142031520278123015544939946091347,
|
|
6524
6531
|
],
|
|
6525
6532
|
[
|
|
6526
6533
|
0, 0.4058451513773971669066064120769614633473,
|
|
6527
|
-
-0.
|
|
6528
|
-
-0.
|
|
6534
|
+
-0.4058451513773972,
|
|
6535
|
+
-0.7415311855993945,
|
|
6529
6536
|
0.7415311855993944398638647732807884070741,
|
|
6530
|
-
-0.
|
|
6537
|
+
-0.9491079123427585,
|
|
6531
6538
|
0.9491079123427585245261896840478512624007,
|
|
6532
6539
|
],
|
|
6533
6540
|
[
|
|
6534
|
-
-0.
|
|
6541
|
+
-0.1834346424956498,
|
|
6535
6542
|
0.1834346424956498049394761423601839806667,
|
|
6536
|
-
-0.
|
|
6543
|
+
-0.525532409916329,
|
|
6537
6544
|
0.5255324099163289858177390491892463490419,
|
|
6538
|
-
-0.
|
|
6545
|
+
-0.7966664774136267,
|
|
6539
6546
|
0.7966664774136267395915539364758304368371,
|
|
6540
|
-
-0.
|
|
6547
|
+
-0.9602898564975363,
|
|
6541
6548
|
0.9602898564975362316835608685694729904282,
|
|
6542
6549
|
],
|
|
6543
6550
|
[
|
|
6544
|
-
0, -0.
|
|
6551
|
+
0, -0.8360311073266358,
|
|
6545
6552
|
0.8360311073266357942994297880697348765441,
|
|
6546
|
-
-0.
|
|
6553
|
+
-0.9681602395076261,
|
|
6547
6554
|
0.9681602395076260898355762029036728700494,
|
|
6548
|
-
-0.
|
|
6555
|
+
-0.3242534234038089,
|
|
6549
6556
|
0.3242534234038089290385380146433366085719,
|
|
6550
|
-
-0.
|
|
6557
|
+
-0.6133714327005904,
|
|
6551
6558
|
0.6133714327005903973087020393414741847857,
|
|
6552
6559
|
],
|
|
6553
6560
|
[
|
|
6554
|
-
-0.
|
|
6561
|
+
-0.14887433898163122,
|
|
6555
6562
|
0.1488743389816312108848260011297199846175,
|
|
6556
|
-
-0.
|
|
6563
|
+
-0.4333953941292472,
|
|
6557
6564
|
0.4333953941292471907992659431657841622,
|
|
6558
|
-
-0.
|
|
6565
|
+
-0.6794095682990244,
|
|
6559
6566
|
0.6794095682990244062343273651148735757692,
|
|
6560
|
-
-0.
|
|
6567
|
+
-0.8650633666889845,
|
|
6561
6568
|
0.8650633666889845107320966884234930485275,
|
|
6562
|
-
-0.
|
|
6569
|
+
-0.9739065285171717,
|
|
6563
6570
|
0.9739065285171717200779640120844520534282,
|
|
6564
6571
|
],
|
|
6565
6572
|
[
|
|
6566
|
-
0, -0.
|
|
6573
|
+
0, -0.26954315595234496,
|
|
6567
6574
|
0.2695431559523449723315319854008615246796,
|
|
6568
|
-
-0.
|
|
6575
|
+
-0.5190961292068118,
|
|
6569
6576
|
0.5190961292068118159257256694586095544802,
|
|
6570
|
-
-0.
|
|
6577
|
+
-0.7301520055740494,
|
|
6571
6578
|
0.7301520055740493240934162520311534580496,
|
|
6572
|
-
-0.
|
|
6579
|
+
-0.8870625997680953,
|
|
6573
6580
|
0.8870625997680952990751577693039272666316,
|
|
6574
|
-
-0.
|
|
6581
|
+
-0.978228658146057,
|
|
6575
6582
|
0.9782286581460569928039380011228573907714,
|
|
6576
6583
|
],
|
|
6577
6584
|
[
|
|
6578
|
-
-0.
|
|
6585
|
+
-0.1252334085114689,
|
|
6579
6586
|
0.1252334085114689154724413694638531299833,
|
|
6580
|
-
-0.
|
|
6587
|
+
-0.3678314989981802,
|
|
6581
6588
|
0.3678314989981801937526915366437175612563,
|
|
6582
|
-
-0.
|
|
6589
|
+
-0.5873179542866175,
|
|
6583
6590
|
0.587317954286617447296702418940534280369,
|
|
6584
|
-
-0.
|
|
6591
|
+
-0.7699026741943047,
|
|
6585
6592
|
0.7699026741943046870368938332128180759849,
|
|
6586
|
-
-0.
|
|
6593
|
+
-0.9041172563704749,
|
|
6587
6594
|
0.9041172563704748566784658661190961925375,
|
|
6588
|
-
-0.
|
|
6595
|
+
-0.9815606342467192,
|
|
6589
6596
|
0.9815606342467192506905490901492808229601,
|
|
6590
6597
|
],
|
|
6591
6598
|
[
|
|
6592
|
-
0, -0.
|
|
6599
|
+
0, -0.2304583159551348,
|
|
6593
6600
|
0.2304583159551347940655281210979888352115,
|
|
6594
|
-
-0.
|
|
6601
|
+
-0.44849275103644687,
|
|
6595
6602
|
0.4484927510364468528779128521276398678019,
|
|
6596
|
-
-0.
|
|
6603
|
+
-0.6423493394403402,
|
|
6597
6604
|
0.6423493394403402206439846069955156500716,
|
|
6598
|
-
-0.
|
|
6605
|
+
-0.8015780907333099,
|
|
6599
6606
|
0.8015780907333099127942064895828598903056,
|
|
6600
|
-
-0.
|
|
6607
|
+
-0.9175983992229779,
|
|
6601
6608
|
0.9175983992229779652065478365007195123904,
|
|
6602
|
-
-0.
|
|
6609
|
+
-0.9841830547185881,
|
|
6603
6610
|
0.9841830547185881494728294488071096110649,
|
|
6604
6611
|
],
|
|
6605
6612
|
[
|
|
6606
|
-
-0.
|
|
6613
|
+
-0.10805494870734367,
|
|
6607
6614
|
0.1080549487073436620662446502198347476119,
|
|
6608
|
-
-0.
|
|
6615
|
+
-0.31911236892788974,
|
|
6609
6616
|
0.3191123689278897604356718241684754668342,
|
|
6610
|
-
-0.
|
|
6617
|
+
-0.5152486363581541,
|
|
6611
6618
|
0.5152486363581540919652907185511886623088,
|
|
6612
|
-
-0.
|
|
6619
|
+
-0.6872929048116855,
|
|
6613
6620
|
0.6872929048116854701480198030193341375384,
|
|
6614
|
-
-0.
|
|
6621
|
+
-0.827201315069765,
|
|
6615
6622
|
0.8272013150697649931897947426503949610397,
|
|
6616
|
-
-0.
|
|
6623
|
+
-0.9284348836635735,
|
|
6617
6624
|
0.928434883663573517336391139377874264477,
|
|
6618
|
-
-0.
|
|
6625
|
+
-0.9862838086968123,
|
|
6619
6626
|
0.986283808696812338841597266704052801676,
|
|
6620
6627
|
],
|
|
6621
6628
|
[
|
|
6622
|
-
0, -0.
|
|
6629
|
+
0, -0.20119409399743451,
|
|
6623
6630
|
0.2011940939974345223006283033945962078128,
|
|
6624
|
-
-0.
|
|
6631
|
+
-0.3941513470775634,
|
|
6625
6632
|
0.3941513470775633698972073709810454683627,
|
|
6626
|
-
-0.
|
|
6633
|
+
-0.5709721726085388,
|
|
6627
6634
|
0.5709721726085388475372267372539106412383,
|
|
6628
|
-
-0.
|
|
6635
|
+
-0.7244177313601701,
|
|
6629
6636
|
0.7244177313601700474161860546139380096308,
|
|
6630
|
-
-0.
|
|
6637
|
+
-0.8482065834104272,
|
|
6631
6638
|
0.8482065834104272162006483207742168513662,
|
|
6632
|
-
-0.
|
|
6639
|
+
-0.937273392400706,
|
|
6633
6640
|
0.9372733924007059043077589477102094712439,
|
|
6634
|
-
-0.
|
|
6641
|
+
-0.9879925180204854,
|
|
6635
6642
|
0.9879925180204854284895657185866125811469,
|
|
6636
6643
|
],
|
|
6637
6644
|
[
|
|
6638
|
-
-0.
|
|
6645
|
+
-0.09501250983763744,
|
|
6639
6646
|
0.0950125098376374401853193354249580631303,
|
|
6640
|
-
-0.
|
|
6647
|
+
-0.2816035507792589,
|
|
6641
6648
|
0.281603550779258913230460501460496106486,
|
|
6642
|
-
-0.
|
|
6649
|
+
-0.45801677765722737,
|
|
6643
6650
|
0.45801677765722738634241944298357757354,
|
|
6644
|
-
-0.
|
|
6651
|
+
-0.6178762444026438,
|
|
6645
6652
|
0.6178762444026437484466717640487910189918,
|
|
6646
|
-
-0.
|
|
6653
|
+
-0.755404408355003,
|
|
6647
6654
|
0.7554044083550030338951011948474422683538,
|
|
6648
|
-
-0.
|
|
6655
|
+
-0.8656312023878318,
|
|
6649
6656
|
0.8656312023878317438804678977123931323873,
|
|
6650
|
-
-0.
|
|
6657
|
+
-0.9445750230732326,
|
|
6651
6658
|
0.9445750230732325760779884155346083450911,
|
|
6652
|
-
-0.
|
|
6659
|
+
-0.9894009349916499,
|
|
6653
6660
|
0.9894009349916499325961541734503326274262,
|
|
6654
6661
|
],
|
|
6655
6662
|
[
|
|
6656
|
-
0, -0.
|
|
6663
|
+
0, -0.17848418149584785,
|
|
6657
6664
|
0.1784841814958478558506774936540655574754,
|
|
6658
|
-
-0.
|
|
6665
|
+
-0.3512317634538763,
|
|
6659
6666
|
0.3512317634538763152971855170953460050405,
|
|
6660
|
-
-0.
|
|
6667
|
+
-0.5126905370864769,
|
|
6661
6668
|
0.5126905370864769678862465686295518745829,
|
|
6662
|
-
-0.
|
|
6669
|
+
-0.6576711592166907,
|
|
6663
6670
|
0.6576711592166907658503022166430023351478,
|
|
6664
|
-
-0.
|
|
6671
|
+
-0.7815140038968014,
|
|
6665
6672
|
0.7815140038968014069252300555204760502239,
|
|
6666
|
-
-0.
|
|
6673
|
+
-0.8802391537269859,
|
|
6667
6674
|
0.8802391537269859021229556944881556926234,
|
|
6668
|
-
-0.
|
|
6675
|
+
-0.9506755217687678,
|
|
6669
6676
|
0.9506755217687677612227169578958030214433,
|
|
6670
|
-
-0.
|
|
6677
|
+
-0.9905754753144174,
|
|
6671
6678
|
0.9905754753144173356754340199406652765077,
|
|
6672
6679
|
],
|
|
6673
6680
|
[
|
|
6674
|
-
-0.
|
|
6681
|
+
-0.0847750130417353,
|
|
6675
6682
|
0.0847750130417353012422618529357838117333,
|
|
6676
|
-
-0.
|
|
6683
|
+
-0.2518862256915055,
|
|
6677
6684
|
0.2518862256915055095889728548779112301628,
|
|
6678
|
-
-0.
|
|
6685
|
+
-0.41175116146284263,
|
|
6679
6686
|
0.4117511614628426460359317938330516370789,
|
|
6680
|
-
-0.
|
|
6687
|
+
-0.5597708310739475,
|
|
6681
6688
|
0.5597708310739475346078715485253291369276,
|
|
6682
|
-
-0.
|
|
6689
|
+
-0.6916870430603532,
|
|
6683
6690
|
0.6916870430603532078748910812888483894522,
|
|
6684
|
-
-0.
|
|
6691
|
+
-0.8037049589725231,
|
|
6685
6692
|
0.8037049589725231156824174550145907971032,
|
|
6686
|
-
-0.
|
|
6693
|
+
-0.8926024664975557,
|
|
6687
6694
|
0.8926024664975557392060605911271455154078,
|
|
6688
|
-
-0.
|
|
6695
|
+
-0.9558239495713977,
|
|
6689
6696
|
0.9558239495713977551811958929297763099728,
|
|
6690
|
-
-0.
|
|
6697
|
+
-0.9915651684209309,
|
|
6691
6698
|
0.9915651684209309467300160047061507702525,
|
|
6692
6699
|
],
|
|
6693
6700
|
[
|
|
6694
|
-
0, -0.
|
|
6701
|
+
0, -0.16035864564022537,
|
|
6695
6702
|
0.1603586456402253758680961157407435495048,
|
|
6696
|
-
-0.
|
|
6703
|
+
-0.31656409996362983,
|
|
6697
6704
|
0.3165640999636298319901173288498449178922,
|
|
6698
|
-
-0.
|
|
6705
|
+
-0.46457074137596094,
|
|
6699
6706
|
0.4645707413759609457172671481041023679762,
|
|
6700
|
-
-0.
|
|
6707
|
+
-0.600545304661681,
|
|
6701
6708
|
0.6005453046616810234696381649462392798683,
|
|
6702
|
-
-0.
|
|
6709
|
+
-0.7209661773352294,
|
|
6703
6710
|
0.7209661773352293786170958608237816296571,
|
|
6704
|
-
-0.
|
|
6711
|
+
-0.8227146565371428,
|
|
6705
6712
|
0.8227146565371428249789224867127139017745,
|
|
6706
|
-
-0.
|
|
6713
|
+
-0.9031559036148179,
|
|
6707
6714
|
0.9031559036148179016426609285323124878093,
|
|
6708
|
-
-0.
|
|
6715
|
+
-0.96020815213483,
|
|
6709
6716
|
0.960208152134830030852778840687651526615,
|
|
6710
|
-
-0.
|
|
6717
|
+
-0.9924068438435844,
|
|
6711
6718
|
0.9924068438435844031890176702532604935893,
|
|
6712
6719
|
],
|
|
6713
6720
|
[
|
|
6714
|
-
-0.
|
|
6721
|
+
-0.07652652113349734,
|
|
6715
6722
|
0.0765265211334973337546404093988382110047,
|
|
6716
|
-
-0.
|
|
6723
|
+
-0.22778585114164507,
|
|
6717
6724
|
0.227785851141645078080496195368574624743,
|
|
6718
|
-
-0.
|
|
6725
|
+
-0.37370608871541955,
|
|
6719
6726
|
0.3737060887154195606725481770249272373957,
|
|
6720
|
-
-0.
|
|
6727
|
+
-0.5108670019508271,
|
|
6721
6728
|
0.5108670019508270980043640509552509984254,
|
|
6722
|
-
-0.
|
|
6729
|
+
-0.636053680726515,
|
|
6723
6730
|
0.6360536807265150254528366962262859367433,
|
|
6724
|
-
-0.
|
|
6731
|
+
-0.7463319064601508,
|
|
6725
6732
|
0.7463319064601507926143050703556415903107,
|
|
6726
|
-
-0.
|
|
6733
|
+
-0.8391169718222188,
|
|
6727
6734
|
0.8391169718222188233945290617015206853296,
|
|
6728
|
-
-0.
|
|
6735
|
+
-0.912234428251326,
|
|
6729
6736
|
0.9122344282513259058677524412032981130491,
|
|
6730
|
-
-0.
|
|
6737
|
+
-0.9639719272779138,
|
|
6731
6738
|
0.963971927277913791267666131197277221912,
|
|
6732
|
-
-0.
|
|
6739
|
+
-0.9931285991850949,
|
|
6733
6740
|
0.9931285991850949247861223884713202782226,
|
|
6734
6741
|
],
|
|
6735
6742
|
[
|
|
6736
|
-
0, -0.
|
|
6743
|
+
0, -0.1455618541608951,
|
|
6737
6744
|
0.1455618541608950909370309823386863301163,
|
|
6738
|
-
-0.
|
|
6745
|
+
-0.2880213168024011,
|
|
6739
6746
|
0.288021316802401096600792516064600319909,
|
|
6740
|
-
-0.
|
|
6747
|
+
-0.4243421202074388,
|
|
6741
6748
|
0.4243421202074387835736688885437880520964,
|
|
6742
|
-
-0.
|
|
6749
|
+
-0.5516188358872198,
|
|
6743
6750
|
0.551618835887219807059018796724313286622,
|
|
6744
|
-
-0.
|
|
6751
|
+
-0.6671388041974123,
|
|
6745
6752
|
0.667138804197412319305966669990339162597,
|
|
6746
|
-
-0.
|
|
6753
|
+
-0.7684399634756779,
|
|
6747
6754
|
0.7684399634756779086158778513062280348209,
|
|
6748
|
-
-0.
|
|
6755
|
+
-0.8533633645833173,
|
|
6749
6756
|
0.8533633645833172836472506385875676702761,
|
|
6750
|
-
-0.
|
|
6757
|
+
-0.9200993341504008,
|
|
6751
6758
|
0.9200993341504008287901871337149688941591,
|
|
6752
|
-
-0.
|
|
6759
|
+
-0.9672268385663063,
|
|
6753
6760
|
0.9672268385663062943166222149076951614246,
|
|
6754
|
-
-0.
|
|
6761
|
+
-0.9937521706203895,
|
|
6755
6762
|
0.9937521706203895002602420359379409291933,
|
|
6756
6763
|
],
|
|
6757
6764
|
[
|
|
6758
|
-
-0.
|
|
6765
|
+
-0.06973927331972223,
|
|
6759
6766
|
0.0697392733197222212138417961186280818222,
|
|
6760
|
-
-0.
|
|
6767
|
+
-0.20786042668822127,
|
|
6761
6768
|
0.2078604266882212854788465339195457342156,
|
|
6762
|
-
-0.
|
|
6769
|
+
-0.34193582089208424,
|
|
6763
6770
|
0.3419358208920842251581474204273796195591,
|
|
6764
|
-
-0.
|
|
6771
|
+
-0.469355837986757,
|
|
6765
6772
|
0.4693558379867570264063307109664063460953,
|
|
6766
|
-
-0.
|
|
6773
|
+
-0.5876404035069116,
|
|
6767
6774
|
0.5876404035069115929588769276386473488776,
|
|
6768
|
-
-0.
|
|
6775
|
+
-0.6944872631866827,
|
|
6769
6776
|
0.6944872631866827800506898357622567712673,
|
|
6770
|
-
-0.
|
|
6777
|
+
-0.7878168059792081,
|
|
6771
6778
|
0.7878168059792081620042779554083515213881,
|
|
6772
|
-
-0.
|
|
6779
|
+
-0.8658125777203002,
|
|
6773
6780
|
0.8658125777203001365364256370193787290847,
|
|
6774
|
-
-0.
|
|
6781
|
+
-0.926956772187174,
|
|
6775
6782
|
0.9269567721871740005206929392590531966353,
|
|
6776
|
-
-0.
|
|
6783
|
+
-0.9700604978354287,
|
|
6777
6784
|
0.9700604978354287271239509867652687108059,
|
|
6778
|
-
-0.
|
|
6785
|
+
-0.9942945854823992,
|
|
6779
6786
|
0.994294585482399292073031421161298980393,
|
|
6780
6787
|
],
|
|
6781
6788
|
[
|
|
6782
|
-
0, -0.
|
|
6789
|
+
0, -0.1332568242984661,
|
|
6783
6790
|
0.1332568242984661109317426822417661370104,
|
|
6784
|
-
-0.
|
|
6791
|
+
-0.26413568097034495,
|
|
6785
6792
|
0.264135680970344930533869538283309602979,
|
|
6786
|
-
-0.
|
|
6793
|
+
-0.3903010380302908,
|
|
6787
6794
|
0.390301038030290831421488872880605458578,
|
|
6788
|
-
-0.
|
|
6795
|
+
-0.5095014778460075,
|
|
6789
6796
|
0.5095014778460075496897930478668464305448,
|
|
6790
|
-
-0.
|
|
6797
|
+
-0.6196098757636461,
|
|
6791
6798
|
0.6196098757636461563850973116495956533871,
|
|
6792
|
-
-0.
|
|
6799
|
+
-0.7186613631319502,
|
|
6793
6800
|
0.7186613631319501944616244837486188483299,
|
|
6794
|
-
-0.
|
|
6801
|
+
-0.8048884016188399,
|
|
6795
6802
|
0.8048884016188398921511184069967785579414,
|
|
6796
|
-
-0.
|
|
6803
|
+
-0.8767523582704416,
|
|
6797
6804
|
0.8767523582704416673781568859341456716389,
|
|
6798
|
-
-0.
|
|
6805
|
+
-0.9329710868260161,
|
|
6799
6806
|
0.9329710868260161023491969890384229782357,
|
|
6800
|
-
-0.
|
|
6807
|
+
-0.9725424712181152,
|
|
6801
6808
|
0.9725424712181152319560240768207773751816,
|
|
6802
|
-
-0.
|
|
6809
|
+
-0.9947693349975522,
|
|
6803
6810
|
0.9947693349975521235239257154455743605736,
|
|
6804
6811
|
],
|
|
6805
6812
|
[
|
|
6806
|
-
-0.
|
|
6813
|
+
-0.06405689286260563,
|
|
6807
6814
|
0.0640568928626056260850430826247450385909,
|
|
6808
|
-
-0.
|
|
6815
|
+
-0.1911188674736163,
|
|
6809
6816
|
0.1911188674736163091586398207570696318404,
|
|
6810
|
-
-0.
|
|
6817
|
+
-0.3150426796961634,
|
|
6811
6818
|
0.3150426796961633743867932913198102407864,
|
|
6812
|
-
-0.
|
|
6819
|
+
-0.4337935076260451,
|
|
6813
6820
|
0.4337935076260451384870842319133497124524,
|
|
6814
|
-
-0.
|
|
6821
|
+
-0.5454214713888396,
|
|
6815
6822
|
0.5454214713888395356583756172183723700107,
|
|
6816
|
-
-0.
|
|
6823
|
+
-0.6480936519369755,
|
|
6817
6824
|
0.6480936519369755692524957869107476266696,
|
|
6818
|
-
-0.
|
|
6825
|
+
-0.7401241915785544,
|
|
6819
6826
|
0.7401241915785543642438281030999784255232,
|
|
6820
|
-
-0.
|
|
6827
|
+
-0.820001985973903,
|
|
6821
6828
|
0.8200019859739029219539498726697452080761,
|
|
6822
|
-
-0.
|
|
6829
|
+
-0.8864155270044011,
|
|
6823
6830
|
0.8864155270044010342131543419821967550873,
|
|
6824
|
-
-0.
|
|
6831
|
+
-0.9382745520027328,
|
|
6825
6832
|
0.9382745520027327585236490017087214496548,
|
|
6826
|
-
-0.
|
|
6833
|
+
-0.9747285559713095,
|
|
6827
6834
|
0.9747285559713094981983919930081690617411,
|
|
6828
|
-
-0.
|
|
6835
|
+
-0.9951872199970213,
|
|
6829
6836
|
0.9951872199970213601799974097007368118745,
|
|
6830
6837
|
],
|
|
6831
6838
|
];
|
|
@@ -7288,7 +7295,7 @@
|
|
|
7288
7295
|
if (hasRequiredPath) return Path;
|
|
7289
7296
|
hasRequiredPath = 1;
|
|
7290
7297
|
Object.defineProperty(Path, "__esModule", { value: true });
|
|
7291
|
-
Path.Path =
|
|
7298
|
+
Path.Path = undefined;
|
|
7292
7299
|
const Factory_1 = requireFactory();
|
|
7293
7300
|
const Shape_1 = requireShape();
|
|
7294
7301
|
const Global_1 = requireGlobal();
|
|
@@ -7471,8 +7478,8 @@
|
|
|
7471
7478
|
return null;
|
|
7472
7479
|
}
|
|
7473
7480
|
static getPointOnLine(dist, P1x, P1y, P2x, P2y, fromX, fromY) {
|
|
7474
|
-
fromX = fromX !== null && fromX !==
|
|
7475
|
-
fromY = fromY !== null && fromY !==
|
|
7481
|
+
fromX = fromX !== null && fromX !== undefined ? fromX : P1x;
|
|
7482
|
+
fromY = fromY !== null && fromY !== undefined ? fromY : P1y;
|
|
7476
7483
|
const len = this.getLineLength(P1x, P1y, P2x, P2y);
|
|
7477
7484
|
if (len < 1e-10) {
|
|
7478
7485
|
return { x: P1x, y: P1y };
|
|
@@ -7901,7 +7908,7 @@
|
|
|
7901
7908
|
if (hasRequiredArrow) return Arrow;
|
|
7902
7909
|
hasRequiredArrow = 1;
|
|
7903
7910
|
Object.defineProperty(Arrow, "__esModule", { value: true });
|
|
7904
|
-
Arrow.Arrow =
|
|
7911
|
+
Arrow.Arrow = undefined;
|
|
7905
7912
|
const Factory_1 = requireFactory();
|
|
7906
7913
|
const Line_1 = requireLine();
|
|
7907
7914
|
const Validators_1 = requireValidators();
|
|
@@ -7988,9 +7995,9 @@
|
|
|
7988
7995
|
const lineRect = super.getSelfRect();
|
|
7989
7996
|
const offset = this.pointerWidth() / 2;
|
|
7990
7997
|
return {
|
|
7991
|
-
x: lineRect.x
|
|
7998
|
+
x: lineRect.x,
|
|
7992
7999
|
y: lineRect.y - offset,
|
|
7993
|
-
width: lineRect.width
|
|
8000
|
+
width: lineRect.width,
|
|
7994
8001
|
height: lineRect.height + offset * 2,
|
|
7995
8002
|
};
|
|
7996
8003
|
}
|
|
@@ -8013,7 +8020,7 @@
|
|
|
8013
8020
|
if (hasRequiredCircle) return Circle;
|
|
8014
8021
|
hasRequiredCircle = 1;
|
|
8015
8022
|
Object.defineProperty(Circle, "__esModule", { value: true });
|
|
8016
|
-
Circle.Circle =
|
|
8023
|
+
Circle.Circle = undefined;
|
|
8017
8024
|
const Factory_1 = requireFactory();
|
|
8018
8025
|
const Shape_1 = requireShape();
|
|
8019
8026
|
const Validators_1 = requireValidators();
|
|
@@ -8059,7 +8066,7 @@
|
|
|
8059
8066
|
if (hasRequiredEllipse) return Ellipse;
|
|
8060
8067
|
hasRequiredEllipse = 1;
|
|
8061
8068
|
Object.defineProperty(Ellipse, "__esModule", { value: true });
|
|
8062
|
-
Ellipse.Ellipse =
|
|
8069
|
+
Ellipse.Ellipse = undefined;
|
|
8063
8070
|
const Factory_1 = requireFactory();
|
|
8064
8071
|
const Shape_1 = requireShape();
|
|
8065
8072
|
const Validators_1 = requireValidators();
|
|
@@ -8109,7 +8116,7 @@
|
|
|
8109
8116
|
if (hasRequiredImage) return Image$1;
|
|
8110
8117
|
hasRequiredImage = 1;
|
|
8111
8118
|
Object.defineProperty(Image$1, "__esModule", { value: true });
|
|
8112
|
-
Image$1.Image =
|
|
8119
|
+
Image$1.Image = undefined;
|
|
8113
8120
|
const Util_1 = requireUtil();
|
|
8114
8121
|
const Factory_1 = requireFactory();
|
|
8115
8122
|
const Shape_1 = requireShape();
|
|
@@ -8200,11 +8207,11 @@
|
|
|
8200
8207
|
}
|
|
8201
8208
|
getWidth() {
|
|
8202
8209
|
var _a, _b;
|
|
8203
|
-
return (_a = this.attrs.width) !== null && _a !==
|
|
8210
|
+
return (_a = this.attrs.width) !== null && _a !== undefined ? _a : (_b = this.image()) === null || _b === undefined ? undefined : _b.width;
|
|
8204
8211
|
}
|
|
8205
8212
|
getHeight() {
|
|
8206
8213
|
var _a, _b;
|
|
8207
|
-
return (_a = this.attrs.height) !== null && _a !==
|
|
8214
|
+
return (_a = this.attrs.height) !== null && _a !== undefined ? _a : (_b = this.image()) === null || _b === undefined ? undefined : _b.height;
|
|
8208
8215
|
}
|
|
8209
8216
|
static fromURL(url, callback, onError = null) {
|
|
8210
8217
|
const img = Util_1.Util.createImageElement();
|
|
@@ -8240,7 +8247,7 @@
|
|
|
8240
8247
|
if (hasRequiredLabel) return Label;
|
|
8241
8248
|
hasRequiredLabel = 1;
|
|
8242
8249
|
Object.defineProperty(Label, "__esModule", { value: true });
|
|
8243
|
-
Label.Tag = Label.Label =
|
|
8250
|
+
Label.Tag = Label.Label = undefined;
|
|
8244
8251
|
const Factory_1 = requireFactory();
|
|
8245
8252
|
const Shape_1 = requireShape();
|
|
8246
8253
|
const Group_1 = requireGroup();
|
|
@@ -8427,7 +8434,7 @@
|
|
|
8427
8434
|
if (hasRequiredRect) return Rect;
|
|
8428
8435
|
hasRequiredRect = 1;
|
|
8429
8436
|
Object.defineProperty(Rect, "__esModule", { value: true });
|
|
8430
|
-
Rect.Rect =
|
|
8437
|
+
Rect.Rect = undefined;
|
|
8431
8438
|
const Factory_1 = requireFactory();
|
|
8432
8439
|
const Shape_1 = requireShape();
|
|
8433
8440
|
const Global_1 = requireGlobal();
|
|
@@ -8462,7 +8469,7 @@
|
|
|
8462
8469
|
if (hasRequiredRegularPolygon) return RegularPolygon;
|
|
8463
8470
|
hasRequiredRegularPolygon = 1;
|
|
8464
8471
|
Object.defineProperty(RegularPolygon, "__esModule", { value: true });
|
|
8465
|
-
RegularPolygon.RegularPolygon =
|
|
8472
|
+
RegularPolygon.RegularPolygon = undefined;
|
|
8466
8473
|
const Factory_1 = requireFactory();
|
|
8467
8474
|
const Shape_1 = requireShape();
|
|
8468
8475
|
const Validators_1 = requireValidators();
|
|
@@ -8540,7 +8547,7 @@
|
|
|
8540
8547
|
if (hasRequiredRing) return Ring;
|
|
8541
8548
|
hasRequiredRing = 1;
|
|
8542
8549
|
Object.defineProperty(Ring, "__esModule", { value: true });
|
|
8543
|
-
Ring.Ring =
|
|
8550
|
+
Ring.Ring = undefined;
|
|
8544
8551
|
const Factory_1 = requireFactory();
|
|
8545
8552
|
const Shape_1 = requireShape();
|
|
8546
8553
|
const Validators_1 = requireValidators();
|
|
@@ -8586,7 +8593,7 @@
|
|
|
8586
8593
|
if (hasRequiredSprite) return Sprite;
|
|
8587
8594
|
hasRequiredSprite = 1;
|
|
8588
8595
|
Object.defineProperty(Sprite, "__esModule", { value: true });
|
|
8589
|
-
Sprite.Sprite =
|
|
8596
|
+
Sprite.Sprite = undefined;
|
|
8590
8597
|
const Factory_1 = requireFactory();
|
|
8591
8598
|
const Shape_1 = requireShape();
|
|
8592
8599
|
const Animation_1 = requireAnimation();
|
|
@@ -8707,7 +8714,7 @@
|
|
|
8707
8714
|
if (hasRequiredStar) return Star;
|
|
8708
8715
|
hasRequiredStar = 1;
|
|
8709
8716
|
Object.defineProperty(Star, "__esModule", { value: true });
|
|
8710
|
-
Star.Star =
|
|
8717
|
+
Star.Star = undefined;
|
|
8711
8718
|
const Factory_1 = requireFactory();
|
|
8712
8719
|
const Shape_1 = requireShape();
|
|
8713
8720
|
const Validators_1 = requireValidators();
|
|
@@ -8758,7 +8765,7 @@
|
|
|
8758
8765
|
if (hasRequiredText) return Text;
|
|
8759
8766
|
hasRequiredText = 1;
|
|
8760
8767
|
Object.defineProperty(Text, "__esModule", { value: true });
|
|
8761
|
-
Text.Text =
|
|
8768
|
+
Text.Text = undefined;
|
|
8762
8769
|
Text.stringToArray = stringToArray;
|
|
8763
8770
|
const Util_1 = requireUtil();
|
|
8764
8771
|
const Factory_1 = requireFactory();
|
|
@@ -8768,8 +8775,15 @@
|
|
|
8768
8775
|
const Global_2 = requireGlobal();
|
|
8769
8776
|
function stringToArray(string) {
|
|
8770
8777
|
return [...string].reduce((acc, char, index, array) => {
|
|
8771
|
-
if (/\p{
|
|
8772
|
-
|
|
8778
|
+
if (/\p{Emoji}/u.test(char)) {
|
|
8779
|
+
const nextChar = array[index + 1];
|
|
8780
|
+
if (nextChar && /\p{Emoji_Modifier}|\u200D/u.test(nextChar)) {
|
|
8781
|
+
acc.push(char + nextChar);
|
|
8782
|
+
array[index + 1] = '';
|
|
8783
|
+
}
|
|
8784
|
+
else {
|
|
8785
|
+
acc.push(char);
|
|
8786
|
+
}
|
|
8773
8787
|
}
|
|
8774
8788
|
else if (/\p{Regional_Indicator}{2}/u.test(char + (array[index + 1] || ''))) {
|
|
8775
8789
|
acc.push(char + array[index + 1]);
|
|
@@ -8777,7 +8791,7 @@
|
|
|
8777
8791
|
else if (index > 0 && /\p{Mn}|\p{Me}|\p{Mc}/u.test(char)) {
|
|
8778
8792
|
acc[acc.length - 1] += char;
|
|
8779
8793
|
}
|
|
8780
|
-
else {
|
|
8794
|
+
else if (char) {
|
|
8781
8795
|
acc.push(char);
|
|
8782
8796
|
}
|
|
8783
8797
|
return acc;
|
|
@@ -8882,7 +8896,7 @@
|
|
|
8882
8896
|
for (n = 0; n < textArrLen; n++) {
|
|
8883
8897
|
var lineTranslateX = 0;
|
|
8884
8898
|
var lineTranslateY = 0;
|
|
8885
|
-
var obj = textArr[n], text = obj.text, width = obj.width, lastLine = obj.lastInParagraph, spacesNumber,
|
|
8899
|
+
var obj = textArr[n], text = obj.text, width = obj.width, lastLine = obj.lastInParagraph, spacesNumber, lineWidth;
|
|
8886
8900
|
context.save();
|
|
8887
8901
|
if (align === RIGHT) {
|
|
8888
8902
|
lineTranslateX += totalWidth - width - padding * 2;
|
|
@@ -8900,7 +8914,6 @@
|
|
|
8900
8914
|
const y = translateY + lineTranslateY + yOffset;
|
|
8901
8915
|
context.moveTo(x, y);
|
|
8902
8916
|
spacesNumber = text.split(' ').length - 1;
|
|
8903
|
-
oneWord = spacesNumber === 0;
|
|
8904
8917
|
lineWidth =
|
|
8905
8918
|
align === JUSTIFY && !lastLine ? totalWidth - padding * 2 : width;
|
|
8906
8919
|
context.lineTo(x + Math.round(lineWidth), y);
|
|
@@ -8916,11 +8929,8 @@
|
|
|
8916
8929
|
const yOffset = Global_1.Konva._fixTextRendering ? -Math.round(fontSize / 4) : 0;
|
|
8917
8930
|
context.moveTo(lineTranslateX, translateY + lineTranslateY + yOffset);
|
|
8918
8931
|
spacesNumber = text.split(' ').length - 1;
|
|
8919
|
-
oneWord = spacesNumber === 0;
|
|
8920
8932
|
lineWidth =
|
|
8921
|
-
align === JUSTIFY && lastLine
|
|
8922
|
-
? totalWidth - padding * 2
|
|
8923
|
-
: width;
|
|
8933
|
+
align === JUSTIFY && !lastLine ? totalWidth - padding * 2 : width;
|
|
8924
8934
|
context.lineTo(lineTranslateX + Math.round(lineWidth), translateY + lineTranslateY + yOffset);
|
|
8925
8935
|
context.lineWidth = fontSize / 15;
|
|
8926
8936
|
const gradient = this._getLinearGradient();
|
|
@@ -9001,17 +9011,17 @@
|
|
|
9001
9011
|
_context.restore();
|
|
9002
9012
|
const scaleFactor = fontSize / 100;
|
|
9003
9013
|
return {
|
|
9004
|
-
actualBoundingBoxAscent: (_a = metrics.actualBoundingBoxAscent) !== null && _a !==
|
|
9005
|
-
actualBoundingBoxDescent: (_b = metrics.actualBoundingBoxDescent) !== null && _b !==
|
|
9006
|
-
actualBoundingBoxLeft: (_c = metrics.actualBoundingBoxLeft) !== null && _c !==
|
|
9007
|
-
actualBoundingBoxRight: (_d = metrics.actualBoundingBoxRight) !== null && _d !==
|
|
9008
|
-
alphabeticBaseline: (_e = metrics.alphabeticBaseline) !== null && _e !==
|
|
9009
|
-
emHeightAscent: (_f = metrics.emHeightAscent) !== null && _f !==
|
|
9010
|
-
emHeightDescent: (_g = metrics.emHeightDescent) !== null && _g !==
|
|
9011
|
-
fontBoundingBoxAscent: (_h = metrics.fontBoundingBoxAscent) !== null && _h !==
|
|
9012
|
-
fontBoundingBoxDescent: (_j = metrics.fontBoundingBoxDescent) !== null && _j !==
|
|
9013
|
-
hangingBaseline: (_k = metrics.hangingBaseline) !== null && _k !==
|
|
9014
|
-
ideographicBaseline: (_l = metrics.ideographicBaseline) !== null && _l !==
|
|
9014
|
+
actualBoundingBoxAscent: (_a = metrics.actualBoundingBoxAscent) !== null && _a !== undefined ? _a : 71.58203125 * scaleFactor,
|
|
9015
|
+
actualBoundingBoxDescent: (_b = metrics.actualBoundingBoxDescent) !== null && _b !== undefined ? _b : 0,
|
|
9016
|
+
actualBoundingBoxLeft: (_c = metrics.actualBoundingBoxLeft) !== null && _c !== undefined ? _c : -7.421875 * scaleFactor,
|
|
9017
|
+
actualBoundingBoxRight: (_d = metrics.actualBoundingBoxRight) !== null && _d !== undefined ? _d : 75.732421875 * scaleFactor,
|
|
9018
|
+
alphabeticBaseline: (_e = metrics.alphabeticBaseline) !== null && _e !== undefined ? _e : 0,
|
|
9019
|
+
emHeightAscent: (_f = metrics.emHeightAscent) !== null && _f !== undefined ? _f : 100 * scaleFactor,
|
|
9020
|
+
emHeightDescent: (_g = metrics.emHeightDescent) !== null && _g !== undefined ? _g : -20 * scaleFactor,
|
|
9021
|
+
fontBoundingBoxAscent: (_h = metrics.fontBoundingBoxAscent) !== null && _h !== undefined ? _h : 91 * scaleFactor,
|
|
9022
|
+
fontBoundingBoxDescent: (_j = metrics.fontBoundingBoxDescent) !== null && _j !== undefined ? _j : 21 * scaleFactor,
|
|
9023
|
+
hangingBaseline: (_k = metrics.hangingBaseline) !== null && _k !== undefined ? _k : 72.80000305175781 * scaleFactor,
|
|
9024
|
+
ideographicBaseline: (_l = metrics.ideographicBaseline) !== null && _l !== undefined ? _l : -21 * scaleFactor,
|
|
9015
9025
|
width: metrics.width,
|
|
9016
9026
|
height: fontSize,
|
|
9017
9027
|
};
|
|
@@ -9039,22 +9049,23 @@
|
|
|
9039
9049
|
_getTextWidth(text) {
|
|
9040
9050
|
const letterSpacing = this.letterSpacing();
|
|
9041
9051
|
const length = text.length;
|
|
9042
|
-
return
|
|
9043
|
-
(length ? letterSpacing * (length - 1) : 0));
|
|
9052
|
+
return getDummyContext().measureText(text).width + letterSpacing * length;
|
|
9044
9053
|
}
|
|
9045
9054
|
_setTextData() {
|
|
9046
9055
|
let lines = this.text().split('\n'), fontSize = +this.fontSize(), textWidth = 0, lineHeightPx = this.lineHeight() * fontSize, width = this.attrs.width, height = this.attrs.height, fixedWidth = width !== AUTO && width !== undefined, fixedHeight = height !== AUTO && height !== undefined, padding = this.padding(), maxWidth = width - padding * 2, maxHeightPx = height - padding * 2, currentHeightPx = 0, wrap = this.wrap(), shouldWrap = wrap !== NONE, wrapAtWord = wrap !== CHAR && shouldWrap, shouldAddEllipsis = this.ellipsis();
|
|
9047
9056
|
this.textArr = [];
|
|
9048
9057
|
getDummyContext().font = this._getContextFont();
|
|
9049
|
-
const additionalWidth = shouldAddEllipsis
|
|
9058
|
+
const additionalWidth = shouldAddEllipsis
|
|
9059
|
+
? this._getTextWidth(ELLIPSIS)
|
|
9060
|
+
: 0;
|
|
9050
9061
|
for (let i = 0, max = lines.length; i < max; ++i) {
|
|
9051
9062
|
let line = lines[i];
|
|
9052
9063
|
let lineWidth = this._getTextWidth(line);
|
|
9053
9064
|
if (fixedWidth && lineWidth > maxWidth) {
|
|
9054
9065
|
while (line.length > 0) {
|
|
9055
|
-
let low = 0, high = line.length, match = '', matchWidth = 0;
|
|
9066
|
+
let low = 0, high = stringToArray(line).length, match = '', matchWidth = 0;
|
|
9056
9067
|
while (low < high) {
|
|
9057
|
-
const mid = (low + high) >>> 1, substr =
|
|
9068
|
+
const mid = (low + high) >>> 1, lineArray = stringToArray(line), substr = lineArray.slice(0, mid + 1).join(''), substrWidth = this._getTextWidth(substr) + additionalWidth;
|
|
9058
9069
|
if (substrWidth <= maxWidth) {
|
|
9059
9070
|
low = mid + 1;
|
|
9060
9071
|
match = substr;
|
|
@@ -9066,20 +9077,22 @@
|
|
|
9066
9077
|
}
|
|
9067
9078
|
if (match) {
|
|
9068
9079
|
if (wrapAtWord) {
|
|
9069
|
-
|
|
9070
|
-
const
|
|
9080
|
+
const lineArray = stringToArray(line);
|
|
9081
|
+
const matchArray = stringToArray(match);
|
|
9082
|
+
const nextChar = lineArray[matchArray.length];
|
|
9071
9083
|
const nextIsSpaceOrDash = nextChar === SPACE || nextChar === DASH;
|
|
9084
|
+
let wrapIndex;
|
|
9072
9085
|
if (nextIsSpaceOrDash && matchWidth <= maxWidth) {
|
|
9073
|
-
wrapIndex =
|
|
9086
|
+
wrapIndex = matchArray.length;
|
|
9074
9087
|
}
|
|
9075
9088
|
else {
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9089
|
+
const lastSpaceIndex = matchArray.lastIndexOf(SPACE);
|
|
9090
|
+
const lastDashIndex = matchArray.lastIndexOf(DASH);
|
|
9091
|
+
wrapIndex = Math.max(lastSpaceIndex, lastDashIndex) + 1;
|
|
9079
9092
|
}
|
|
9080
9093
|
if (wrapIndex > 0) {
|
|
9081
9094
|
low = wrapIndex;
|
|
9082
|
-
match =
|
|
9095
|
+
match = lineArray.slice(0, low).join('');
|
|
9083
9096
|
matchWidth = this._getTextWidth(match);
|
|
9084
9097
|
}
|
|
9085
9098
|
}
|
|
@@ -9092,8 +9105,8 @@
|
|
|
9092
9105
|
this._tryToAddEllipsisToLastLine();
|
|
9093
9106
|
break;
|
|
9094
9107
|
}
|
|
9095
|
-
|
|
9096
|
-
line =
|
|
9108
|
+
const lineArray = stringToArray(line);
|
|
9109
|
+
line = lineArray.slice(low).join('').trimLeft();
|
|
9097
9110
|
if (line.length > 0) {
|
|
9098
9111
|
lineWidth = this._getTextWidth(line);
|
|
9099
9112
|
if (lineWidth <= maxWidth) {
|
|
@@ -9200,7 +9213,7 @@
|
|
|
9200
9213
|
if (hasRequiredTextPath) return TextPath;
|
|
9201
9214
|
hasRequiredTextPath = 1;
|
|
9202
9215
|
Object.defineProperty(TextPath, "__esModule", { value: true });
|
|
9203
|
-
TextPath.TextPath =
|
|
9216
|
+
TextPath.TextPath = undefined;
|
|
9204
9217
|
const Util_1 = requireUtil();
|
|
9205
9218
|
const Factory_1 = requireFactory();
|
|
9206
9219
|
const Shape_1 = requireShape();
|
|
@@ -9437,8 +9450,8 @@
|
|
|
9437
9450
|
Factory_1.Factory.addGetterSetter(TextPath$1, 'textBaseline', 'middle');
|
|
9438
9451
|
Factory_1.Factory.addGetterSetter(TextPath$1, 'fontVariant', NORMAL);
|
|
9439
9452
|
Factory_1.Factory.addGetterSetter(TextPath$1, 'text', EMPTY_STRING);
|
|
9440
|
-
Factory_1.Factory.addGetterSetter(TextPath$1, 'textDecoration',
|
|
9441
|
-
Factory_1.Factory.addGetterSetter(TextPath$1, 'kerningFunc',
|
|
9453
|
+
Factory_1.Factory.addGetterSetter(TextPath$1, 'textDecoration', '');
|
|
9454
|
+
Factory_1.Factory.addGetterSetter(TextPath$1, 'kerningFunc', undefined);
|
|
9442
9455
|
return TextPath;
|
|
9443
9456
|
}
|
|
9444
9457
|
|
|
@@ -9450,7 +9463,7 @@
|
|
|
9450
9463
|
if (hasRequiredTransformer) return Transformer;
|
|
9451
9464
|
hasRequiredTransformer = 1;
|
|
9452
9465
|
Object.defineProperty(Transformer, "__esModule", { value: true });
|
|
9453
|
-
Transformer.Transformer =
|
|
9466
|
+
Transformer.Transformer = undefined;
|
|
9454
9467
|
const Util_1 = requireUtil();
|
|
9455
9468
|
const Factory_1 = requireFactory();
|
|
9456
9469
|
const Node_1 = requireNode();
|
|
@@ -9550,7 +9563,6 @@
|
|
|
9550
9563
|
'bottom-center',
|
|
9551
9564
|
'bottom-right',
|
|
9552
9565
|
];
|
|
9553
|
-
const MAX_SAFE_INTEGER = 100000000;
|
|
9554
9566
|
function getCenter(shape) {
|
|
9555
9567
|
return {
|
|
9556
9568
|
x: shape.x +
|
|
@@ -9746,8 +9758,8 @@
|
|
|
9746
9758
|
const node = this.getNode();
|
|
9747
9759
|
if (!node) {
|
|
9748
9760
|
return {
|
|
9749
|
-
x: -
|
|
9750
|
-
y: -
|
|
9761
|
+
x: -1e8,
|
|
9762
|
+
y: -1e8,
|
|
9751
9763
|
width: 0,
|
|
9752
9764
|
height: 0,
|
|
9753
9765
|
rotation: 0,
|
|
@@ -10126,12 +10138,12 @@
|
|
|
10126
10138
|
const node = this.getNode();
|
|
10127
10139
|
activeTransformersCount--;
|
|
10128
10140
|
this._fire('transformend', { evt: e, target: node });
|
|
10129
|
-
(_a = this.getLayer()) === null || _a ===
|
|
10141
|
+
(_a = this.getLayer()) === null || _a === undefined ? undefined : _a.batchDraw();
|
|
10130
10142
|
if (node) {
|
|
10131
10143
|
this._nodes.forEach((target) => {
|
|
10132
10144
|
var _a;
|
|
10133
10145
|
target._fire('transformend', { evt: e, target });
|
|
10134
|
-
(_a = target.getLayer()) === null || _a ===
|
|
10146
|
+
(_a = target.getLayer()) === null || _a === undefined ? undefined : _a.batchDraw();
|
|
10135
10147
|
});
|
|
10136
10148
|
}
|
|
10137
10149
|
this._movingAnchorName = null;
|
|
@@ -10244,7 +10256,7 @@
|
|
|
10244
10256
|
.multiply(localTransform);
|
|
10245
10257
|
const attrs = newLocalTransform.decompose();
|
|
10246
10258
|
node.setAttrs(attrs);
|
|
10247
|
-
(_a = node.getLayer()) === null || _a ===
|
|
10259
|
+
(_a = node.getLayer()) === null || _a === undefined ? undefined : _a.batchDraw();
|
|
10248
10260
|
});
|
|
10249
10261
|
this.rotation(Util_1.Util._getRotation(newAttrs.rotation));
|
|
10250
10262
|
this._nodes.forEach((node) => {
|
|
@@ -10359,7 +10371,7 @@
|
|
|
10359
10371
|
styleFunc(node);
|
|
10360
10372
|
});
|
|
10361
10373
|
}
|
|
10362
|
-
(_a = this.getLayer()) === null || _a ===
|
|
10374
|
+
(_a = this.getLayer()) === null || _a === undefined ? undefined : _a.batchDraw();
|
|
10363
10375
|
}
|
|
10364
10376
|
isTransforming() {
|
|
10365
10377
|
return this._transforming;
|
|
@@ -10443,8 +10455,8 @@
|
|
|
10443
10455
|
Factory_1.Factory.addGetterSetter(Transformer$1, 'centeredScaling', false);
|
|
10444
10456
|
Factory_1.Factory.addGetterSetter(Transformer$1, 'ignoreStroke', false);
|
|
10445
10457
|
Factory_1.Factory.addGetterSetter(Transformer$1, 'padding', 0, (0, Validators_1.getNumberValidator)());
|
|
10446
|
-
Factory_1.Factory.addGetterSetter(Transformer$1, 'node');
|
|
10447
10458
|
Factory_1.Factory.addGetterSetter(Transformer$1, 'nodes');
|
|
10459
|
+
Factory_1.Factory.addGetterSetter(Transformer$1, 'node');
|
|
10448
10460
|
Factory_1.Factory.addGetterSetter(Transformer$1, 'boundBoxFunc');
|
|
10449
10461
|
Factory_1.Factory.addGetterSetter(Transformer$1, 'anchorDragBoundFunc');
|
|
10450
10462
|
Factory_1.Factory.addGetterSetter(Transformer$1, 'anchorStyleFunc');
|
|
@@ -10466,7 +10478,7 @@
|
|
|
10466
10478
|
if (hasRequiredWedge) return Wedge;
|
|
10467
10479
|
hasRequiredWedge = 1;
|
|
10468
10480
|
Object.defineProperty(Wedge, "__esModule", { value: true });
|
|
10469
|
-
Wedge.Wedge =
|
|
10481
|
+
Wedge.Wedge = undefined;
|
|
10470
10482
|
const Factory_1 = requireFactory();
|
|
10471
10483
|
const Shape_1 = requireShape();
|
|
10472
10484
|
const Global_1 = requireGlobal();
|
|
@@ -10517,7 +10529,7 @@
|
|
|
10517
10529
|
if (hasRequiredBlur) return Blur;
|
|
10518
10530
|
hasRequiredBlur = 1;
|
|
10519
10531
|
Object.defineProperty(Blur, "__esModule", { value: true });
|
|
10520
|
-
Blur.Blur =
|
|
10532
|
+
Blur.Blur = undefined;
|
|
10521
10533
|
const Factory_1 = requireFactory();
|
|
10522
10534
|
const Node_1 = requireNode();
|
|
10523
10535
|
const Validators_1 = requireValidators();
|
|
@@ -10566,7 +10578,8 @@
|
|
|
10566
10578
|
function filterGaussBlurRGBA(imageData, radius) {
|
|
10567
10579
|
const pixels = imageData.data, width = imageData.width, height = imageData.height;
|
|
10568
10580
|
let x, y, i, p, yp, yi, yw, r_sum, g_sum, b_sum, a_sum, r_out_sum, g_out_sum, b_out_sum, a_out_sum, r_in_sum, g_in_sum, b_in_sum, a_in_sum, pr, pg, pb, pa, rbs;
|
|
10569
|
-
|
|
10581
|
+
const div = radius + radius + 1, widthMinus1 = width - 1, heightMinus1 = height - 1, radiusPlus1 = radius + 1, sumFactor = (radiusPlus1 * (radiusPlus1 + 1)) / 2, stackStart = new BlurStack(), mul_sum = mul_table[radius], shg_sum = shg_table[radius];
|
|
10582
|
+
let stackEnd = null, stack = stackStart, stackIn = null, stackOut = null;
|
|
10570
10583
|
for (i = 1; i < div; i++) {
|
|
10571
10584
|
stack = stack.next = new BlurStack();
|
|
10572
10585
|
if (i === radiusPlus1) {
|
|
@@ -10764,13 +10777,13 @@
|
|
|
10764
10777
|
if (hasRequiredBrighten) return Brighten;
|
|
10765
10778
|
hasRequiredBrighten = 1;
|
|
10766
10779
|
Object.defineProperty(Brighten, "__esModule", { value: true });
|
|
10767
|
-
Brighten.Brighten =
|
|
10780
|
+
Brighten.Brighten = undefined;
|
|
10768
10781
|
const Factory_1 = requireFactory();
|
|
10769
10782
|
const Node_1 = requireNode();
|
|
10770
10783
|
const Validators_1 = requireValidators();
|
|
10771
10784
|
const Brighten$1 = function (imageData) {
|
|
10772
|
-
|
|
10773
|
-
for (i = 0; i < len; i += 4) {
|
|
10785
|
+
const brightness = this.brightness() * 255, data = imageData.data, len = data.length;
|
|
10786
|
+
for (let i = 0; i < len; i += 4) {
|
|
10774
10787
|
data[i] += brightness;
|
|
10775
10788
|
data[i + 1] += brightness;
|
|
10776
10789
|
data[i + 2] += brightness;
|
|
@@ -10789,14 +10802,15 @@
|
|
|
10789
10802
|
if (hasRequiredContrast) return Contrast;
|
|
10790
10803
|
hasRequiredContrast = 1;
|
|
10791
10804
|
Object.defineProperty(Contrast, "__esModule", { value: true });
|
|
10792
|
-
Contrast.Contrast =
|
|
10805
|
+
Contrast.Contrast = undefined;
|
|
10793
10806
|
const Factory_1 = requireFactory();
|
|
10794
10807
|
const Node_1 = requireNode();
|
|
10795
10808
|
const Validators_1 = requireValidators();
|
|
10796
10809
|
const Contrast$1 = function (imageData) {
|
|
10797
10810
|
const adjust = Math.pow((this.contrast() + 100) / 100, 2);
|
|
10798
|
-
|
|
10799
|
-
|
|
10811
|
+
const data = imageData.data, nPixels = data.length;
|
|
10812
|
+
let red = 150, green = 150, blue = 150;
|
|
10813
|
+
for (let i = 0; i < nPixels; i += 4) {
|
|
10800
10814
|
red = data[i];
|
|
10801
10815
|
green = data[i + 1];
|
|
10802
10816
|
blue = data[i + 2];
|
|
@@ -10836,13 +10850,14 @@
|
|
|
10836
10850
|
if (hasRequiredEmboss) return Emboss;
|
|
10837
10851
|
hasRequiredEmboss = 1;
|
|
10838
10852
|
Object.defineProperty(Emboss, "__esModule", { value: true });
|
|
10839
|
-
Emboss.Emboss =
|
|
10853
|
+
Emboss.Emboss = undefined;
|
|
10840
10854
|
const Factory_1 = requireFactory();
|
|
10841
10855
|
const Node_1 = requireNode();
|
|
10842
10856
|
const Util_1 = requireUtil();
|
|
10843
10857
|
const Validators_1 = requireValidators();
|
|
10844
10858
|
const Emboss$1 = function (imageData) {
|
|
10845
|
-
|
|
10859
|
+
const strength = this.embossStrength() * 10, greyLevel = this.embossWhiteLevel() * 255, direction = this.embossDirection(), blend = this.embossBlend(), data = imageData.data, w = imageData.width, h = imageData.height, w4 = w * 4;
|
|
10860
|
+
let dirY = 0, dirX = 0, y = h;
|
|
10846
10861
|
switch (direction) {
|
|
10847
10862
|
case 'top-left':
|
|
10848
10863
|
dirY = -1;
|
|
@@ -10938,8 +10953,8 @@
|
|
|
10938
10953
|
Emboss.Emboss = Emboss$1;
|
|
10939
10954
|
Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossStrength', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
|
|
10940
10955
|
Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossWhiteLevel', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
|
|
10941
|
-
Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossDirection', 'top-left',
|
|
10942
|
-
Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossBlend', false,
|
|
10956
|
+
Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossDirection', 'top-left', undefined, Factory_1.Factory.afterSetFilter);
|
|
10957
|
+
Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossBlend', false, undefined, Factory_1.Factory.afterSetFilter);
|
|
10943
10958
|
return Emboss;
|
|
10944
10959
|
}
|
|
10945
10960
|
|
|
@@ -10951,29 +10966,30 @@
|
|
|
10951
10966
|
if (hasRequiredEnhance) return Enhance;
|
|
10952
10967
|
hasRequiredEnhance = 1;
|
|
10953
10968
|
Object.defineProperty(Enhance, "__esModule", { value: true });
|
|
10954
|
-
Enhance.Enhance =
|
|
10969
|
+
Enhance.Enhance = undefined;
|
|
10955
10970
|
const Factory_1 = requireFactory();
|
|
10956
10971
|
const Node_1 = requireNode();
|
|
10957
10972
|
const Validators_1 = requireValidators();
|
|
10958
10973
|
function remap(fromValue, fromMin, fromMax, toMin, toMax) {
|
|
10959
|
-
|
|
10974
|
+
const fromRange = fromMax - fromMin, toRange = toMax - toMin;
|
|
10960
10975
|
if (fromRange === 0) {
|
|
10961
10976
|
return toMin + toRange / 2;
|
|
10962
10977
|
}
|
|
10963
10978
|
if (toRange === 0) {
|
|
10964
10979
|
return toMin;
|
|
10965
10980
|
}
|
|
10966
|
-
toValue = (fromValue - fromMin) / fromRange;
|
|
10981
|
+
let toValue = (fromValue - fromMin) / fromRange;
|
|
10967
10982
|
toValue = toRange * toValue + toMin;
|
|
10968
10983
|
return toValue;
|
|
10969
10984
|
}
|
|
10970
10985
|
const Enhance$1 = function (imageData) {
|
|
10971
|
-
|
|
10986
|
+
const data = imageData.data, nSubPixels = data.length;
|
|
10987
|
+
let rMin = data[0], rMax = rMin, r, gMin = data[1], gMax = gMin, g, bMin = data[2], bMax = bMin, b;
|
|
10972
10988
|
const enhanceAmount = this.enhance();
|
|
10973
10989
|
if (enhanceAmount === 0) {
|
|
10974
10990
|
return;
|
|
10975
10991
|
}
|
|
10976
|
-
for (i = 0; i < nSubPixels; i += 4) {
|
|
10992
|
+
for (let i = 0; i < nSubPixels; i += 4) {
|
|
10977
10993
|
r = data[i + 0];
|
|
10978
10994
|
if (r < rMin) {
|
|
10979
10995
|
rMin = r;
|
|
@@ -11028,7 +11044,7 @@
|
|
|
11028
11044
|
bGoalMax = bMax + enhanceAmount * (bMax - bMid);
|
|
11029
11045
|
bGoalMin = bMin + enhanceAmount * (bMin - bMid);
|
|
11030
11046
|
}
|
|
11031
|
-
for (i = 0; i < nSubPixels; i += 4) {
|
|
11047
|
+
for (let i = 0; i < nSubPixels; i += 4) {
|
|
11032
11048
|
data[i + 0] = remap(data[i + 0], rMin, rMax, rGoalMin, rGoalMax);
|
|
11033
11049
|
data[i + 1] = remap(data[i + 1], gMin, gMax, gGoalMin, gGoalMax);
|
|
11034
11050
|
data[i + 2] = remap(data[i + 2], bMin, bMax, bGoalMin, bGoalMax);
|
|
@@ -11047,11 +11063,11 @@
|
|
|
11047
11063
|
if (hasRequiredGrayscale) return Grayscale;
|
|
11048
11064
|
hasRequiredGrayscale = 1;
|
|
11049
11065
|
Object.defineProperty(Grayscale, "__esModule", { value: true });
|
|
11050
|
-
Grayscale.Grayscale =
|
|
11066
|
+
Grayscale.Grayscale = undefined;
|
|
11051
11067
|
const Grayscale$1 = function (imageData) {
|
|
11052
|
-
|
|
11053
|
-
for (i = 0; i < len; i += 4) {
|
|
11054
|
-
brightness = 0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2];
|
|
11068
|
+
const data = imageData.data, len = data.length;
|
|
11069
|
+
for (let i = 0; i < len; i += 4) {
|
|
11070
|
+
const brightness = 0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2];
|
|
11055
11071
|
data[i] = brightness;
|
|
11056
11072
|
data[i + 1] = brightness;
|
|
11057
11073
|
data[i + 2] = brightness;
|
|
@@ -11069,7 +11085,7 @@
|
|
|
11069
11085
|
if (hasRequiredHSL) return HSL;
|
|
11070
11086
|
hasRequiredHSL = 1;
|
|
11071
11087
|
Object.defineProperty(HSL, "__esModule", { value: true });
|
|
11072
|
-
HSL.HSL =
|
|
11088
|
+
HSL.HSL = undefined;
|
|
11073
11089
|
const Factory_1 = requireFactory();
|
|
11074
11090
|
const Node_1 = requireNode();
|
|
11075
11091
|
const Validators_1 = requireValidators();
|
|
@@ -11077,13 +11093,13 @@
|
|
|
11077
11093
|
Factory_1.Factory.addGetterSetter(Node_1.Node, 'saturation', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
|
|
11078
11094
|
Factory_1.Factory.addGetterSetter(Node_1.Node, 'luminance', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
|
|
11079
11095
|
const HSL$1 = function (imageData) {
|
|
11080
|
-
|
|
11096
|
+
const data = imageData.data, nPixels = data.length, v = 1, s = Math.pow(2, this.saturation()), h = Math.abs(this.hue() + 360) % 360, l = this.luminance() * 127;
|
|
11081
11097
|
const vsu = v * s * Math.cos((h * Math.PI) / 180), vsw = v * s * Math.sin((h * Math.PI) / 180);
|
|
11082
11098
|
const rr = 0.299 * v + 0.701 * vsu + 0.167 * vsw, rg = 0.587 * v - 0.587 * vsu + 0.33 * vsw, rb = 0.114 * v - 0.114 * vsu - 0.497 * vsw;
|
|
11083
11099
|
const gr = 0.299 * v - 0.299 * vsu - 0.328 * vsw, gg = 0.587 * v + 0.413 * vsu + 0.035 * vsw, gb = 0.114 * v - 0.114 * vsu + 0.293 * vsw;
|
|
11084
11100
|
const br = 0.299 * v - 0.3 * vsu + 1.25 * vsw, bg = 0.587 * v - 0.586 * vsu - 1.05 * vsw, bb = 0.114 * v + 0.886 * vsu - 0.2 * vsw;
|
|
11085
11101
|
let r, g, b, a;
|
|
11086
|
-
for (i = 0; i < nPixels; i += 4) {
|
|
11102
|
+
for (let i = 0; i < nPixels; i += 4) {
|
|
11087
11103
|
r = data[i + 0];
|
|
11088
11104
|
g = data[i + 1];
|
|
11089
11105
|
b = data[i + 2];
|
|
@@ -11106,7 +11122,7 @@
|
|
|
11106
11122
|
if (hasRequiredHSV) return HSV;
|
|
11107
11123
|
hasRequiredHSV = 1;
|
|
11108
11124
|
Object.defineProperty(HSV, "__esModule", { value: true });
|
|
11109
|
-
HSV.HSV =
|
|
11125
|
+
HSV.HSV = undefined;
|
|
11110
11126
|
const Factory_1 = requireFactory();
|
|
11111
11127
|
const Node_1 = requireNode();
|
|
11112
11128
|
const Validators_1 = requireValidators();
|
|
@@ -11143,10 +11159,10 @@
|
|
|
11143
11159
|
if (hasRequiredInvert) return Invert;
|
|
11144
11160
|
hasRequiredInvert = 1;
|
|
11145
11161
|
Object.defineProperty(Invert, "__esModule", { value: true });
|
|
11146
|
-
Invert.Invert =
|
|
11162
|
+
Invert.Invert = undefined;
|
|
11147
11163
|
const Invert$1 = function (imageData) {
|
|
11148
|
-
|
|
11149
|
-
for (i = 0; i < len; i += 4) {
|
|
11164
|
+
const data = imageData.data, len = data.length;
|
|
11165
|
+
for (let i = 0; i < len; i += 4) {
|
|
11150
11166
|
data[i] = 255 - data[i];
|
|
11151
11167
|
data[i + 1] = 255 - data[i + 1];
|
|
11152
11168
|
data[i + 2] = 255 - data[i + 2];
|
|
@@ -11164,31 +11180,31 @@
|
|
|
11164
11180
|
if (hasRequiredKaleidoscope) return Kaleidoscope;
|
|
11165
11181
|
hasRequiredKaleidoscope = 1;
|
|
11166
11182
|
Object.defineProperty(Kaleidoscope, "__esModule", { value: true });
|
|
11167
|
-
Kaleidoscope.Kaleidoscope =
|
|
11183
|
+
Kaleidoscope.Kaleidoscope = undefined;
|
|
11168
11184
|
const Factory_1 = requireFactory();
|
|
11169
11185
|
const Node_1 = requireNode();
|
|
11170
11186
|
const Util_1 = requireUtil();
|
|
11171
11187
|
const Validators_1 = requireValidators();
|
|
11172
11188
|
const ToPolar = function (src, dst, opt) {
|
|
11173
|
-
|
|
11174
|
-
let
|
|
11175
|
-
x = xSize - xMid;
|
|
11176
|
-
y = ySize - yMid;
|
|
11177
|
-
rad = Math.sqrt(x * x + y * y);
|
|
11189
|
+
const srcPixels = src.data, dstPixels = dst.data, xSize = src.width, ySize = src.height, xMid = opt.polarCenterX || xSize / 2, yMid = opt.polarCenterY || ySize / 2;
|
|
11190
|
+
let rMax = Math.sqrt(xMid * xMid + yMid * yMid);
|
|
11191
|
+
let x = xSize - xMid;
|
|
11192
|
+
let y = ySize - yMid;
|
|
11193
|
+
const rad = Math.sqrt(x * x + y * y);
|
|
11178
11194
|
rMax = rad > rMax ? rad : rMax;
|
|
11179
|
-
|
|
11180
|
-
|
|
11181
|
-
for (theta = 0; theta < tSize; theta += 1) {
|
|
11182
|
-
sin = Math.sin(theta * conversion);
|
|
11183
|
-
cos = Math.cos(theta * conversion);
|
|
11184
|
-
for (radius = 0; radius < rSize; radius += 1) {
|
|
11195
|
+
const rSize = ySize, tSize = xSize;
|
|
11196
|
+
const conversion = ((360 / tSize) * Math.PI) / 180;
|
|
11197
|
+
for (let theta = 0; theta < tSize; theta += 1) {
|
|
11198
|
+
const sin = Math.sin(theta * conversion);
|
|
11199
|
+
const cos = Math.cos(theta * conversion);
|
|
11200
|
+
for (let radius = 0; radius < rSize; radius += 1) {
|
|
11185
11201
|
x = Math.floor(xMid + ((rMax * radius) / rSize) * cos);
|
|
11186
11202
|
y = Math.floor(yMid + ((rMax * radius) / rSize) * sin);
|
|
11187
|
-
i = (y * xSize + x) * 4;
|
|
11188
|
-
r = srcPixels[i + 0];
|
|
11189
|
-
g = srcPixels[i + 1];
|
|
11190
|
-
b = srcPixels[i + 2];
|
|
11191
|
-
a = srcPixels[i + 3];
|
|
11203
|
+
let i = (y * xSize + x) * 4;
|
|
11204
|
+
const r = srcPixels[i + 0];
|
|
11205
|
+
const g = srcPixels[i + 1];
|
|
11206
|
+
const b = srcPixels[i + 2];
|
|
11207
|
+
const a = srcPixels[i + 3];
|
|
11192
11208
|
i = (theta + radius * xSize) * 4;
|
|
11193
11209
|
dstPixels[i + 0] = r;
|
|
11194
11210
|
dstPixels[i + 1] = g;
|
|
@@ -11198,28 +11214,28 @@
|
|
|
11198
11214
|
}
|
|
11199
11215
|
};
|
|
11200
11216
|
const FromPolar = function (src, dst, opt) {
|
|
11201
|
-
|
|
11202
|
-
let
|
|
11203
|
-
x = xSize - xMid;
|
|
11204
|
-
y = ySize - yMid;
|
|
11205
|
-
rad = Math.sqrt(x * x + y * y);
|
|
11217
|
+
const srcPixels = src.data, dstPixels = dst.data, xSize = src.width, ySize = src.height, xMid = opt.polarCenterX || xSize / 2, yMid = opt.polarCenterY || ySize / 2;
|
|
11218
|
+
let rMax = Math.sqrt(xMid * xMid + yMid * yMid);
|
|
11219
|
+
let x = xSize - xMid;
|
|
11220
|
+
let y = ySize - yMid;
|
|
11221
|
+
const rad = Math.sqrt(x * x + y * y);
|
|
11206
11222
|
rMax = rad > rMax ? rad : rMax;
|
|
11207
|
-
|
|
11223
|
+
const rSize = ySize, tSize = xSize, phaseShift = 0;
|
|
11208
11224
|
let x1, y1;
|
|
11209
11225
|
for (x = 0; x < xSize; x += 1) {
|
|
11210
11226
|
for (y = 0; y < ySize; y += 1) {
|
|
11211
|
-
dx = x - xMid;
|
|
11212
|
-
dy = y - yMid;
|
|
11213
|
-
radius = (Math.sqrt(dx * dx + dy * dy) * rSize) / rMax;
|
|
11214
|
-
theta = ((Math.atan2(dy, dx) * 180) / Math.PI + 360 + phaseShift) % 360;
|
|
11227
|
+
const dx = x - xMid;
|
|
11228
|
+
const dy = y - yMid;
|
|
11229
|
+
const radius = (Math.sqrt(dx * dx + dy * dy) * rSize) / rMax;
|
|
11230
|
+
let theta = ((Math.atan2(dy, dx) * 180) / Math.PI + 360 + phaseShift) % 360;
|
|
11215
11231
|
theta = (theta * tSize) / 360;
|
|
11216
11232
|
x1 = Math.floor(theta);
|
|
11217
11233
|
y1 = Math.floor(radius);
|
|
11218
|
-
i = (y1 * xSize + x1) * 4;
|
|
11219
|
-
r = srcPixels[i + 0];
|
|
11220
|
-
g = srcPixels[i + 1];
|
|
11221
|
-
b = srcPixels[i + 2];
|
|
11222
|
-
a = srcPixels[i + 3];
|
|
11234
|
+
let i = (y1 * xSize + x1) * 4;
|
|
11235
|
+
const r = srcPixels[i + 0];
|
|
11236
|
+
const g = srcPixels[i + 1];
|
|
11237
|
+
const b = srcPixels[i + 2];
|
|
11238
|
+
const a = srcPixels[i + 3];
|
|
11223
11239
|
i = (y * xSize + x) * 4;
|
|
11224
11240
|
dstPixels[i + 0] = r;
|
|
11225
11241
|
dstPixels[i + 1] = g;
|
|
@@ -11294,7 +11310,7 @@
|
|
|
11294
11310
|
sectionSize *= 2;
|
|
11295
11311
|
}
|
|
11296
11312
|
}
|
|
11297
|
-
FromPolar(scratchData, imageData, {
|
|
11313
|
+
FromPolar(scratchData, imageData, { });
|
|
11298
11314
|
};
|
|
11299
11315
|
Kaleidoscope.Kaleidoscope = Kaleidoscope$1;
|
|
11300
11316
|
Factory_1.Factory.addGetterSetter(Node_1.Node, 'kaleidoscopePower', 2, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
|
|
@@ -11310,7 +11326,7 @@
|
|
|
11310
11326
|
if (hasRequiredMask) return Mask;
|
|
11311
11327
|
hasRequiredMask = 1;
|
|
11312
11328
|
Object.defineProperty(Mask, "__esModule", { value: true });
|
|
11313
|
-
Mask.Mask =
|
|
11329
|
+
Mask.Mask = undefined;
|
|
11314
11330
|
const Factory_1 = requireFactory();
|
|
11315
11331
|
const Node_1 = requireNode();
|
|
11316
11332
|
const Validators_1 = requireValidators();
|
|
@@ -11441,7 +11457,8 @@
|
|
|
11441
11457
|
return maskResult;
|
|
11442
11458
|
}
|
|
11443
11459
|
const Mask$1 = function (imageData) {
|
|
11444
|
-
|
|
11460
|
+
const threshold = this.threshold();
|
|
11461
|
+
let mask = backgroundMask(imageData, threshold);
|
|
11445
11462
|
if (mask) {
|
|
11446
11463
|
mask = erodeMask(mask, imageData.width, imageData.height);
|
|
11447
11464
|
mask = dilateMask(mask, imageData.width, imageData.height);
|
|
@@ -11463,7 +11480,7 @@
|
|
|
11463
11480
|
if (hasRequiredNoise) return Noise;
|
|
11464
11481
|
hasRequiredNoise = 1;
|
|
11465
11482
|
Object.defineProperty(Noise, "__esModule", { value: true });
|
|
11466
|
-
Noise.Noise =
|
|
11483
|
+
Noise.Noise = undefined;
|
|
11467
11484
|
const Factory_1 = requireFactory();
|
|
11468
11485
|
const Node_1 = requireNode();
|
|
11469
11486
|
const Validators_1 = requireValidators();
|
|
@@ -11488,7 +11505,7 @@
|
|
|
11488
11505
|
if (hasRequiredPixelate) return Pixelate;
|
|
11489
11506
|
hasRequiredPixelate = 1;
|
|
11490
11507
|
Object.defineProperty(Pixelate, "__esModule", { value: true });
|
|
11491
|
-
Pixelate.Pixelate =
|
|
11508
|
+
Pixelate.Pixelate = undefined;
|
|
11492
11509
|
const Factory_1 = requireFactory();
|
|
11493
11510
|
const Util_1 = requireUtil();
|
|
11494
11511
|
const Node_1 = requireNode();
|
|
@@ -11561,13 +11578,13 @@
|
|
|
11561
11578
|
if (hasRequiredPosterize) return Posterize;
|
|
11562
11579
|
hasRequiredPosterize = 1;
|
|
11563
11580
|
Object.defineProperty(Posterize, "__esModule", { value: true });
|
|
11564
|
-
Posterize.Posterize =
|
|
11581
|
+
Posterize.Posterize = undefined;
|
|
11565
11582
|
const Factory_1 = requireFactory();
|
|
11566
11583
|
const Node_1 = requireNode();
|
|
11567
11584
|
const Validators_1 = requireValidators();
|
|
11568
11585
|
const Posterize$1 = function (imageData) {
|
|
11569
|
-
|
|
11570
|
-
for (i = 0; i < len; i += 1) {
|
|
11586
|
+
const levels = Math.round(this.levels() * 254) + 1, data = imageData.data, len = data.length, scale = 255 / levels;
|
|
11587
|
+
for (let i = 0; i < len; i += 1) {
|
|
11571
11588
|
data[i] = Math.floor(data[i] / scale) * scale;
|
|
11572
11589
|
}
|
|
11573
11590
|
};
|
|
@@ -11584,15 +11601,14 @@
|
|
|
11584
11601
|
if (hasRequiredRGB) return RGB;
|
|
11585
11602
|
hasRequiredRGB = 1;
|
|
11586
11603
|
Object.defineProperty(RGB, "__esModule", { value: true });
|
|
11587
|
-
RGB.RGB =
|
|
11604
|
+
RGB.RGB = undefined;
|
|
11588
11605
|
const Factory_1 = requireFactory();
|
|
11589
11606
|
const Node_1 = requireNode();
|
|
11590
11607
|
const Validators_1 = requireValidators();
|
|
11591
11608
|
const RGB$1 = function (imageData) {
|
|
11592
|
-
|
|
11593
|
-
for (i = 0; i < nPixels; i += 4) {
|
|
11594
|
-
brightness =
|
|
11595
|
-
(0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2]) / 255;
|
|
11609
|
+
const data = imageData.data, nPixels = data.length, red = this.red(), green = this.green(), blue = this.blue();
|
|
11610
|
+
for (let i = 0; i < nPixels; i += 4) {
|
|
11611
|
+
const brightness = (0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2]) / 255;
|
|
11596
11612
|
data[i] = brightness * red;
|
|
11597
11613
|
data[i + 1] = brightness * green;
|
|
11598
11614
|
data[i + 2] = brightness * blue;
|
|
@@ -11636,7 +11652,7 @@
|
|
|
11636
11652
|
if (hasRequiredRGBA) return RGBA;
|
|
11637
11653
|
hasRequiredRGBA = 1;
|
|
11638
11654
|
Object.defineProperty(RGBA, "__esModule", { value: true });
|
|
11639
|
-
RGBA.RGBA =
|
|
11655
|
+
RGBA.RGBA = undefined;
|
|
11640
11656
|
const Factory_1 = requireFactory();
|
|
11641
11657
|
const Node_1 = requireNode();
|
|
11642
11658
|
const Validators_1 = requireValidators();
|
|
@@ -11698,13 +11714,13 @@
|
|
|
11698
11714
|
if (hasRequiredSepia) return Sepia;
|
|
11699
11715
|
hasRequiredSepia = 1;
|
|
11700
11716
|
Object.defineProperty(Sepia, "__esModule", { value: true });
|
|
11701
|
-
Sepia.Sepia =
|
|
11717
|
+
Sepia.Sepia = undefined;
|
|
11702
11718
|
const Sepia$1 = function (imageData) {
|
|
11703
|
-
|
|
11704
|
-
for (i = 0; i < nPixels; i += 4) {
|
|
11705
|
-
r = data[i + 0];
|
|
11706
|
-
g = data[i + 1];
|
|
11707
|
-
b = data[i + 2];
|
|
11719
|
+
const data = imageData.data, nPixels = data.length;
|
|
11720
|
+
for (let i = 0; i < nPixels; i += 4) {
|
|
11721
|
+
const r = data[i + 0];
|
|
11722
|
+
const g = data[i + 1];
|
|
11723
|
+
const b = data[i + 2];
|
|
11708
11724
|
data[i + 0] = Math.min(255, r * 0.393 + g * 0.769 + b * 0.189);
|
|
11709
11725
|
data[i + 1] = Math.min(255, r * 0.349 + g * 0.686 + b * 0.168);
|
|
11710
11726
|
data[i + 2] = Math.min(255, r * 0.272 + g * 0.534 + b * 0.131);
|
|
@@ -11722,7 +11738,7 @@
|
|
|
11722
11738
|
if (hasRequiredSolarize) return Solarize;
|
|
11723
11739
|
hasRequiredSolarize = 1;
|
|
11724
11740
|
Object.defineProperty(Solarize, "__esModule", { value: true });
|
|
11725
|
-
Solarize.Solarize =
|
|
11741
|
+
Solarize.Solarize = undefined;
|
|
11726
11742
|
const Solarize$1 = function (imageData) {
|
|
11727
11743
|
const data = imageData.data, w = imageData.width, h = imageData.height, w4 = w * 4;
|
|
11728
11744
|
let y = h;
|
|
@@ -11761,7 +11777,7 @@
|
|
|
11761
11777
|
if (hasRequiredThreshold) return Threshold;
|
|
11762
11778
|
hasRequiredThreshold = 1;
|
|
11763
11779
|
Object.defineProperty(Threshold, "__esModule", { value: true });
|
|
11764
|
-
Threshold.Threshold =
|
|
11780
|
+
Threshold.Threshold = undefined;
|
|
11765
11781
|
const Factory_1 = requireFactory();
|
|
11766
11782
|
const Node_1 = requireNode();
|
|
11767
11783
|
const Validators_1 = requireValidators();
|
|
@@ -11782,7 +11798,7 @@
|
|
|
11782
11798
|
if (hasRequired_FullInternals) return _FullInternals;
|
|
11783
11799
|
hasRequired_FullInternals = 1;
|
|
11784
11800
|
Object.defineProperty(_FullInternals, "__esModule", { value: true });
|
|
11785
|
-
_FullInternals.Konva =
|
|
11801
|
+
_FullInternals.Konva = undefined;
|
|
11786
11802
|
const _CoreInternals_1 = require_CoreInternals();
|
|
11787
11803
|
const Arc_1 = requireArc();
|
|
11788
11804
|
const Arrow_1 = requireArrow();
|
|
@@ -11951,8 +11967,8 @@
|
|
|
11951
11967
|
this.setColor(r, g, b);
|
|
11952
11968
|
}
|
|
11953
11969
|
/**
|
|
11954
|
-
* Returns the color as a string in hexadecimal color syntax `#RGB` using its primary color
|
|
11955
|
-
*
|
|
11970
|
+
* Returns the color as a string in hexadecimal color syntax `#RGB` using its primary color components
|
|
11971
|
+
* (red, green, blue) written as hexadecimal numbers.
|
|
11956
11972
|
*/
|
|
11957
11973
|
asHex() {
|
|
11958
11974
|
return "#" + this.HEX;
|
|
@@ -12007,8 +12023,8 @@
|
|
|
12007
12023
|
const konvaPoints = [];
|
|
12008
12024
|
params.points.forEach((point) => konvaPoints.push(point.x, point.y));
|
|
12009
12025
|
this._ref = new Konva.Line({
|
|
12010
|
-
stroke: (_a = params.color) !== null && _a !==
|
|
12011
|
-
strokeWidth: (_b = params.width) !== null && _b !==
|
|
12026
|
+
stroke: (_a = params.color) !== null && _a !== undefined ? _a : "#ff0000",
|
|
12027
|
+
strokeWidth: (_b = params.width) !== null && _b !== undefined ? _b : 4,
|
|
12012
12028
|
globalCompositeOperation: "source-over",
|
|
12013
12029
|
lineCap: "round",
|
|
12014
12030
|
lineJoin: "round",
|
|
@@ -12115,12 +12131,12 @@
|
|
|
12115
12131
|
x: params.position.x,
|
|
12116
12132
|
y: params.position.y,
|
|
12117
12133
|
text: params.text,
|
|
12118
|
-
fontSize: (_a = params.fontSize) !== null && _a !==
|
|
12134
|
+
fontSize: (_a = params.fontSize) !== null && _a !== undefined ? _a : 34,
|
|
12119
12135
|
fontFamily: this.TEXT_FONT_FAMILY,
|
|
12120
|
-
fill: (_b = params.color) !== null && _b !==
|
|
12136
|
+
fill: (_b = params.color) !== null && _b !== undefined ? _b : "#ff0000",
|
|
12121
12137
|
align: "left",
|
|
12122
12138
|
draggable: true,
|
|
12123
|
-
rotation: (_c = params.rotation) !== null && _c !==
|
|
12139
|
+
rotation: (_c = params.rotation) !== null && _c !== undefined ? _c : 0,
|
|
12124
12140
|
});
|
|
12125
12141
|
this._ref.width(this._ref.getTextWidth());
|
|
12126
12142
|
this._ref.on("transform", (e) => {
|
|
@@ -12216,15 +12232,15 @@
|
|
|
12216
12232
|
if (!params.position)
|
|
12217
12233
|
params.position = { x: 100, y: 100 };
|
|
12218
12234
|
this._ref = new Konva.Rect({
|
|
12219
|
-
stroke: (_a = params.color) !== null && _a !==
|
|
12220
|
-
strokeWidth: (_b = params.lineWidth) !== null && _b !==
|
|
12235
|
+
stroke: (_a = params.color) !== null && _a !== undefined ? _a : "#ff0000",
|
|
12236
|
+
strokeWidth: (_b = params.lineWidth) !== null && _b !== undefined ? _b : 4,
|
|
12221
12237
|
globalCompositeOperation: "source-over",
|
|
12222
12238
|
lineCap: "round",
|
|
12223
12239
|
lineJoin: "round",
|
|
12224
12240
|
x: params.position.x,
|
|
12225
12241
|
y: params.position.y,
|
|
12226
|
-
width: (_c = params.width) !== null && _c !==
|
|
12227
|
-
height: (_d = params.height) !== null && _d !==
|
|
12242
|
+
width: (_c = params.width) !== null && _c !== undefined ? _c : 200,
|
|
12243
|
+
height: (_d = params.height) !== null && _d !== undefined ? _d : 200,
|
|
12228
12244
|
draggable: true,
|
|
12229
12245
|
strokeScaleEnabled: false,
|
|
12230
12246
|
});
|
|
@@ -12330,8 +12346,8 @@
|
|
|
12330
12346
|
if (!params.radius)
|
|
12331
12347
|
params.radius = { x: 25, y: 25 };
|
|
12332
12348
|
this._ref = new Konva.Ellipse({
|
|
12333
|
-
stroke: (_a = params.color) !== null && _a !==
|
|
12334
|
-
strokeWidth: (_b = params.lineWidth) !== null && _b !==
|
|
12349
|
+
stroke: (_a = params.color) !== null && _a !== undefined ? _a : "#ff0000",
|
|
12350
|
+
strokeWidth: (_b = params.lineWidth) !== null && _b !== undefined ? _b : 4,
|
|
12335
12351
|
globalCompositeOperation: "source-over",
|
|
12336
12352
|
lineCap: "round",
|
|
12337
12353
|
lineJoin: "round",
|
|
@@ -12471,8 +12487,8 @@
|
|
|
12471
12487
|
if (!params.end)
|
|
12472
12488
|
params.end = { x: 100, y: 100 };
|
|
12473
12489
|
this._ref = new Konva.Arrow({
|
|
12474
|
-
stroke: (_a = params.color) !== null && _a !==
|
|
12475
|
-
fill: (_b = params.color) !== null && _b !==
|
|
12490
|
+
stroke: (_a = params.color) !== null && _a !== undefined ? _a : "#ff0000",
|
|
12491
|
+
fill: (_b = params.color) !== null && _b !== undefined ? _b : "#ff0000",
|
|
12476
12492
|
strokeWidth: 4,
|
|
12477
12493
|
globalCompositeOperation: "source-over",
|
|
12478
12494
|
lineCap: "round",
|
|
@@ -12618,8 +12634,8 @@
|
|
|
12618
12634
|
x: params.position.x,
|
|
12619
12635
|
y: params.position.y,
|
|
12620
12636
|
image: this._canvasImage,
|
|
12621
|
-
width: (_a = params.width) !== null && _a !==
|
|
12622
|
-
height: (_b = params.height) !== null && _b !==
|
|
12637
|
+
width: (_a = params.width) !== null && _a !== undefined ? _a : 0,
|
|
12638
|
+
height: (_b = params.height) !== null && _b !== undefined ? _b : 0,
|
|
12623
12639
|
draggable: true,
|
|
12624
12640
|
});
|
|
12625
12641
|
this._ref.on("transform", (e) => {
|
|
@@ -12727,10 +12743,10 @@
|
|
|
12727
12743
|
this._ref = new Konva.Shape({
|
|
12728
12744
|
x: params.position.x,
|
|
12729
12745
|
y: params.position.y,
|
|
12730
|
-
width: (_a = params.width) !== null && _a !==
|
|
12731
|
-
height: (_b = params.height) !== null && _b !==
|
|
12732
|
-
stroke: (_c = params.color) !== null && _c !==
|
|
12733
|
-
strokeWidth: (_d = params.lineWidth) !== null && _d !==
|
|
12746
|
+
width: (_a = params.width) !== null && _a !== undefined ? _a : 200,
|
|
12747
|
+
height: (_b = params.height) !== null && _b !== undefined ? _b : 200,
|
|
12748
|
+
stroke: (_c = params.color) !== null && _c !== undefined ? _c : "#ff0000",
|
|
12749
|
+
strokeWidth: (_d = params.lineWidth) !== null && _d !== undefined ? _d : 4,
|
|
12734
12750
|
draggable: true,
|
|
12735
12751
|
strokeScaleEnabled: false,
|
|
12736
12752
|
globalCompositeOperation: "source-over",
|
|
@@ -13004,9 +13020,9 @@
|
|
|
13004
13020
|
if (!Konva)
|
|
13005
13021
|
throw new Error('Markup error: Konva is not initialized. Forgot to add <script src="https://unpkg.com/konva@9/konva.min.js"></script> to your page?');
|
|
13006
13022
|
this._viewer = viewer;
|
|
13007
|
-
this._worldTransformer = worldTransformer !== null && worldTransformer !==
|
|
13023
|
+
this._worldTransformer = worldTransformer !== null && worldTransformer !== undefined ? worldTransformer : new WorldTransform();
|
|
13008
13024
|
this._container = container;
|
|
13009
|
-
this._containerEvents = containerEvents !== null && containerEvents !==
|
|
13025
|
+
this._containerEvents = containerEvents !== null && containerEvents !== undefined ? containerEvents : [];
|
|
13010
13026
|
this._markupContainer = document.createElement("div");
|
|
13011
13027
|
this._markupContainer.id = "markup-container";
|
|
13012
13028
|
this._markupContainer.style.position = "absolute";
|
|
@@ -13036,9 +13052,9 @@
|
|
|
13036
13052
|
// this._containerEvents.forEach((x) => this._markupContainer.removeEventListener(x, this.redirectToViewer));
|
|
13037
13053
|
}
|
|
13038
13054
|
this.destroyKonva();
|
|
13039
|
-
(_a = this._resizeObserver) === null || _a ===
|
|
13055
|
+
(_a = this._resizeObserver) === null || _a === undefined ? undefined : _a.disconnect();
|
|
13040
13056
|
this._resizeObserver = undefined;
|
|
13041
|
-
(_b = this._markupContainer) === null || _b ===
|
|
13057
|
+
(_b = this._markupContainer) === null || _b === undefined ? undefined : _b.remove();
|
|
13042
13058
|
this._markupContainer = undefined;
|
|
13043
13059
|
this._container = undefined;
|
|
13044
13060
|
this._viewer = undefined;
|
|
@@ -13061,11 +13077,11 @@
|
|
|
13061
13077
|
}
|
|
13062
13078
|
colorizeAllMarkup(r, g, b) {
|
|
13063
13079
|
const hexColor = new MarkupColor(r, g, b).asHex();
|
|
13064
|
-
this.getObjects().filter((obj) => { var _a; return (_a = obj.setColor) === null || _a ===
|
|
13080
|
+
this.getObjects().filter((obj) => { var _a; return (_a = obj.setColor) === null || _a === undefined ? undefined : _a.call(obj, hexColor); });
|
|
13065
13081
|
}
|
|
13066
13082
|
colorizeSelectedMarkups(r, g, b) {
|
|
13067
13083
|
const hexColor = new MarkupColor(r, g, b).asHex();
|
|
13068
|
-
this.getSelectedObjects().filter((obj) => { var _a; return (_a = obj.setColor) === null || _a ===
|
|
13084
|
+
this.getSelectedObjects().filter((obj) => { var _a; return (_a = obj.setColor) === null || _a === undefined ? undefined : _a.call(obj, hexColor); });
|
|
13069
13085
|
}
|
|
13070
13086
|
setViewpoint(viewpoint) {
|
|
13071
13087
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -13074,9 +13090,9 @@
|
|
|
13074
13090
|
this.removeImageInput();
|
|
13075
13091
|
this._konvaStage.scale({ x: 1, y: 1 });
|
|
13076
13092
|
this._konvaStage.position({ x: 0, y: 0 });
|
|
13077
|
-
const markupColor = ((_a = viewpoint.custom_fields) === null || _a ===
|
|
13093
|
+
const markupColor = ((_a = viewpoint.custom_fields) === null || _a === undefined ? undefined : _a.markup_color) || { r: 255, g: 0, b: 0 };
|
|
13078
13094
|
this.setMarkupColor(markupColor.r, markupColor.g, markupColor.b);
|
|
13079
|
-
(_b = viewpoint.lines) === null || _b ===
|
|
13095
|
+
(_b = viewpoint.lines) === null || _b === undefined ? undefined : _b.forEach((line) => {
|
|
13080
13096
|
const linePoints = [];
|
|
13081
13097
|
line.points.forEach((point) => {
|
|
13082
13098
|
const screenPoint = this._worldTransformer.worldToScreen(point);
|
|
@@ -13085,28 +13101,28 @@
|
|
|
13085
13101
|
});
|
|
13086
13102
|
this.addLine(linePoints, line.color, line.type, line.width, line.id);
|
|
13087
13103
|
});
|
|
13088
|
-
(_c = viewpoint.texts) === null || _c ===
|
|
13104
|
+
(_c = viewpoint.texts) === null || _c === undefined ? undefined : _c.forEach((text) => {
|
|
13089
13105
|
const screenPoint = this._worldTransformer.worldToScreen(text.position);
|
|
13090
13106
|
this.addText(text.text, screenPoint, text.angle, text.color, text.text_size, text.font_size, text.id);
|
|
13091
13107
|
});
|
|
13092
|
-
(_d = viewpoint.rectangles) === null || _d ===
|
|
13108
|
+
(_d = viewpoint.rectangles) === null || _d === undefined ? undefined : _d.forEach((rect) => {
|
|
13093
13109
|
const screenPoint = this._worldTransformer.worldToScreen(rect.position);
|
|
13094
13110
|
this.addRectangle(screenPoint, rect.width, rect.height, rect.line_width, rect.color, rect.id);
|
|
13095
13111
|
});
|
|
13096
|
-
(_e = viewpoint.ellipses) === null || _e ===
|
|
13112
|
+
(_e = viewpoint.ellipses) === null || _e === undefined ? undefined : _e.forEach((ellipse) => {
|
|
13097
13113
|
const screenPoint = this._worldTransformer.worldToScreen(ellipse.position);
|
|
13098
13114
|
this.addEllipse(screenPoint, ellipse.radius, ellipse.line_width, ellipse.color, ellipse.id);
|
|
13099
13115
|
});
|
|
13100
|
-
(_f = viewpoint.arrows) === null || _f ===
|
|
13116
|
+
(_f = viewpoint.arrows) === null || _f === undefined ? undefined : _f.forEach((arrow) => {
|
|
13101
13117
|
const startPoint = this._worldTransformer.worldToScreen(arrow.start);
|
|
13102
13118
|
const endPoint = this._worldTransformer.worldToScreen(arrow.end);
|
|
13103
13119
|
this.addArrow(startPoint, endPoint, arrow.color, arrow.id);
|
|
13104
13120
|
});
|
|
13105
|
-
(_g = viewpoint.clouds) === null || _g ===
|
|
13121
|
+
(_g = viewpoint.clouds) === null || _g === undefined ? undefined : _g.forEach((cloud) => {
|
|
13106
13122
|
const screenPoint = this._worldTransformer.worldToScreen(cloud.position);
|
|
13107
13123
|
this.addCloud(screenPoint, cloud.width, cloud.height, cloud.line_width, cloud.color, cloud.id);
|
|
13108
13124
|
});
|
|
13109
|
-
(_h = viewpoint.images) === null || _h ===
|
|
13125
|
+
(_h = viewpoint.images) === null || _h === undefined ? undefined : _h.forEach((image) => {
|
|
13110
13126
|
const screenPoint = this._worldTransformer.worldToScreen(image.position);
|
|
13111
13127
|
this.addImage(screenPoint, image.src, image.width, image.height, image.id);
|
|
13112
13128
|
});
|
|
@@ -13423,7 +13439,7 @@
|
|
|
13423
13439
|
this.removeTextInput();
|
|
13424
13440
|
this.removeImageInput();
|
|
13425
13441
|
this.clearOverlay();
|
|
13426
|
-
(_a = this._konvaStage) === null || _a ===
|
|
13442
|
+
(_a = this._konvaStage) === null || _a === undefined ? undefined : _a.destroy();
|
|
13427
13443
|
this._groupImages = undefined;
|
|
13428
13444
|
this._groupGeometry = undefined;
|
|
13429
13445
|
this._groupTexts = undefined;
|
|
@@ -13661,7 +13677,7 @@
|
|
|
13661
13677
|
}
|
|
13662
13678
|
removeTextInput() {
|
|
13663
13679
|
var _a;
|
|
13664
|
-
(_a = this._textInputRef) === null || _a ===
|
|
13680
|
+
(_a = this._textInputRef) === null || _a === undefined ? undefined : _a.remove();
|
|
13665
13681
|
this._textInputRef = null;
|
|
13666
13682
|
this._textInputPos = null;
|
|
13667
13683
|
this._textInputAngle = 0;
|
|
@@ -13704,7 +13720,7 @@
|
|
|
13704
13720
|
}
|
|
13705
13721
|
removeImageInput() {
|
|
13706
13722
|
var _a;
|
|
13707
|
-
(_a = this._imageInputRef) === null || _a ===
|
|
13723
|
+
(_a = this._imageInputRef) === null || _a === undefined ? undefined : _a.remove();
|
|
13708
13724
|
this._imageInputRef = null;
|
|
13709
13725
|
this._imageInputPos = null;
|
|
13710
13726
|
}
|
|
@@ -13713,7 +13729,7 @@
|
|
|
13713
13729
|
if (!text)
|
|
13714
13730
|
return;
|
|
13715
13731
|
// in case of edit - remove old Konva.Text object
|
|
13716
|
-
(_a = this.getSelectedObjects().at(0)) === null || _a ===
|
|
13732
|
+
(_a = this.getSelectedObjects().at(0)) === null || _a === undefined ? undefined : _a.delete();
|
|
13717
13733
|
this.clearSelected();
|
|
13718
13734
|
this.removeTextInput();
|
|
13719
13735
|
// in case we have old viewpoint without font_size
|
|
@@ -13792,7 +13808,7 @@
|
|
|
13792
13808
|
if (!position || !src)
|
|
13793
13809
|
return;
|
|
13794
13810
|
// in case of edit - remove old Image placeholder object
|
|
13795
|
-
(_a = this.getSelectedObjects().at(0)) === null || _a ===
|
|
13811
|
+
(_a = this.getSelectedObjects().at(0)) === null || _a === undefined ? undefined : _a.delete();
|
|
13796
13812
|
this.clearSelected();
|
|
13797
13813
|
this.removeImageInput();
|
|
13798
13814
|
const konvaImage = new KonvaImage({
|