@visactor/vrender 0.16.18-alpha.0 → 0.16.19-alpha.1
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/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/index.js +461 -77
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -4795,6 +4795,130 @@
|
|
|
4795
4795
|
}();
|
|
4796
4796
|
TextMeasure.ALPHABET_CHAR_SET = "abcdefghijklmnopqrstuvwxyz", TextMeasure.NUMBERS_CHAR_SET = "0123456789", TextMeasure.FULL_SIZE_CHAR = "字";
|
|
4797
4797
|
|
|
4798
|
+
var hasConsole = "undefined" != typeof console;
|
|
4799
|
+
function log(method, level, input) {
|
|
4800
|
+
var args = [level].concat([].slice.call(input));
|
|
4801
|
+
hasConsole && console[method].apply(console, args);
|
|
4802
|
+
}
|
|
4803
|
+
var LoggerLevel;
|
|
4804
|
+
!function (LoggerLevel) {
|
|
4805
|
+
LoggerLevel[LoggerLevel.None = 0] = "None", LoggerLevel[LoggerLevel.Error = 1] = "Error", LoggerLevel[LoggerLevel.Warn = 2] = "Warn", LoggerLevel[LoggerLevel.Info = 3] = "Info", LoggerLevel[LoggerLevel.Debug = 4] = "Debug";
|
|
4806
|
+
}(LoggerLevel || (LoggerLevel = {}));
|
|
4807
|
+
var Logger = /*#__PURE__*/function () {
|
|
4808
|
+
function Logger() {
|
|
4809
|
+
var level = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : LoggerLevel.None;
|
|
4810
|
+
var method = arguments.length > 1 ? arguments[1] : undefined;
|
|
4811
|
+
_classCallCheck(this, Logger);
|
|
4812
|
+
this._onErrorHandler = [], this._level = level, this._method = method;
|
|
4813
|
+
}
|
|
4814
|
+
_createClass(Logger, [{
|
|
4815
|
+
key: "addErrorHandler",
|
|
4816
|
+
value: function addErrorHandler(handler) {
|
|
4817
|
+
this._onErrorHandler.find(function (h) {
|
|
4818
|
+
return h === handler;
|
|
4819
|
+
}) || this._onErrorHandler.push(handler);
|
|
4820
|
+
}
|
|
4821
|
+
}, {
|
|
4822
|
+
key: "removeErrorHandler",
|
|
4823
|
+
value: function removeErrorHandler(handler) {
|
|
4824
|
+
var index = this._onErrorHandler.findIndex(function (h) {
|
|
4825
|
+
return h === handler;
|
|
4826
|
+
});
|
|
4827
|
+
index < 0 || this._onErrorHandler.splice(index, 1);
|
|
4828
|
+
}
|
|
4829
|
+
}, {
|
|
4830
|
+
key: "callErrorHandler",
|
|
4831
|
+
value: function callErrorHandler() {
|
|
4832
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
4833
|
+
args[_key] = arguments[_key];
|
|
4834
|
+
}
|
|
4835
|
+
this._onErrorHandler.forEach(function (h) {
|
|
4836
|
+
return h.apply(void 0, args);
|
|
4837
|
+
});
|
|
4838
|
+
}
|
|
4839
|
+
}, {
|
|
4840
|
+
key: "canLogInfo",
|
|
4841
|
+
value: function canLogInfo() {
|
|
4842
|
+
return this._level >= LoggerLevel.Info;
|
|
4843
|
+
}
|
|
4844
|
+
}, {
|
|
4845
|
+
key: "canLogDebug",
|
|
4846
|
+
value: function canLogDebug() {
|
|
4847
|
+
return this._level >= LoggerLevel.Debug;
|
|
4848
|
+
}
|
|
4849
|
+
}, {
|
|
4850
|
+
key: "canLogError",
|
|
4851
|
+
value: function canLogError() {
|
|
4852
|
+
return this._level >= LoggerLevel.Error;
|
|
4853
|
+
}
|
|
4854
|
+
}, {
|
|
4855
|
+
key: "canLogWarn",
|
|
4856
|
+
value: function canLogWarn() {
|
|
4857
|
+
return this._level >= LoggerLevel.Warn;
|
|
4858
|
+
}
|
|
4859
|
+
}, {
|
|
4860
|
+
key: "level",
|
|
4861
|
+
value: function level(levelValue) {
|
|
4862
|
+
return arguments.length ? (this._level = +levelValue, this) : this._level;
|
|
4863
|
+
}
|
|
4864
|
+
}, {
|
|
4865
|
+
key: "error",
|
|
4866
|
+
value: function error() {
|
|
4867
|
+
var _a;
|
|
4868
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
4869
|
+
args[_key2] = arguments[_key2];
|
|
4870
|
+
}
|
|
4871
|
+
return this._level >= LoggerLevel.Error && (this._onErrorHandler.length ? this.callErrorHandler.apply(this, args) : log(null !== (_a = this._method) && void 0 !== _a ? _a : "error", "ERROR", args)), this;
|
|
4872
|
+
}
|
|
4873
|
+
}, {
|
|
4874
|
+
key: "warn",
|
|
4875
|
+
value: function warn() {
|
|
4876
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
4877
|
+
args[_key3] = arguments[_key3];
|
|
4878
|
+
}
|
|
4879
|
+
return this._level >= LoggerLevel.Warn && log(this._method || "warn", "WARN", args), this;
|
|
4880
|
+
}
|
|
4881
|
+
}, {
|
|
4882
|
+
key: "info",
|
|
4883
|
+
value: function info() {
|
|
4884
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
4885
|
+
args[_key4] = arguments[_key4];
|
|
4886
|
+
}
|
|
4887
|
+
return this._level >= LoggerLevel.Info && log(this._method || "log", "INFO", args), this;
|
|
4888
|
+
}
|
|
4889
|
+
}, {
|
|
4890
|
+
key: "debug",
|
|
4891
|
+
value: function debug() {
|
|
4892
|
+
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
4893
|
+
args[_key5] = arguments[_key5];
|
|
4894
|
+
}
|
|
4895
|
+
return this._level >= LoggerLevel.Debug && log(this._method || "log", "DEBUG", args), this;
|
|
4896
|
+
}
|
|
4897
|
+
}], [{
|
|
4898
|
+
key: "getInstance",
|
|
4899
|
+
value: function getInstance(level, method) {
|
|
4900
|
+
return Logger._instance && isNumber$2(level) ? Logger._instance.level(level) : Logger._instance || (Logger._instance = new Logger(level, method)), Logger._instance;
|
|
4901
|
+
}
|
|
4902
|
+
}, {
|
|
4903
|
+
key: "setInstance",
|
|
4904
|
+
value: function setInstance(logger) {
|
|
4905
|
+
return Logger._instance = logger;
|
|
4906
|
+
}
|
|
4907
|
+
}, {
|
|
4908
|
+
key: "setInstanceLevel",
|
|
4909
|
+
value: function setInstanceLevel(level) {
|
|
4910
|
+
Logger._instance ? Logger._instance.level(level) : Logger._instance = new Logger(level);
|
|
4911
|
+
}
|
|
4912
|
+
}, {
|
|
4913
|
+
key: "clearInstance",
|
|
4914
|
+
value: function clearInstance() {
|
|
4915
|
+
Logger._instance = null;
|
|
4916
|
+
}
|
|
4917
|
+
}]);
|
|
4918
|
+
return Logger;
|
|
4919
|
+
}();
|
|
4920
|
+
Logger._instance = null;
|
|
4921
|
+
|
|
4798
4922
|
var circleThreshold = tau - 1e-8;
|
|
4799
4923
|
var BoundsContext = /*#__PURE__*/function () {
|
|
4800
4924
|
function BoundsContext(bounds) {
|
|
@@ -6295,9 +6419,13 @@
|
|
|
6295
6419
|
verticalMode: 0,
|
|
6296
6420
|
whiteSpace: "no-wrap",
|
|
6297
6421
|
heightLimit: 1 / 0,
|
|
6298
|
-
lineClamp: 1 / 0
|
|
6422
|
+
lineClamp: 1 / 0,
|
|
6423
|
+
suffixPosition: "end"
|
|
6299
6424
|
};
|
|
6300
|
-
var
|
|
6425
|
+
var DefaultPickStyle = {
|
|
6426
|
+
pickStrokeBuffer: 0
|
|
6427
|
+
};
|
|
6428
|
+
var DefaultStyle = Object.assign(Object.assign(Object.assign(Object.assign({
|
|
6301
6429
|
opacity: 1,
|
|
6302
6430
|
background: null,
|
|
6303
6431
|
texture: null,
|
|
@@ -6308,7 +6436,7 @@
|
|
|
6308
6436
|
blur: 0,
|
|
6309
6437
|
cursor: null,
|
|
6310
6438
|
html: null
|
|
6311
|
-
}, DefaultFillStyle), DefaultStrokeStyle), DefaultLayout);
|
|
6439
|
+
}, DefaultFillStyle), DefaultStrokeStyle), DefaultLayout), DefaultPickStyle);
|
|
6312
6440
|
var DefaultConnectAttribute = {
|
|
6313
6441
|
connectedType: "none",
|
|
6314
6442
|
connectedStyle: {},
|
|
@@ -6398,7 +6526,7 @@
|
|
|
6398
6526
|
var DefaultPathAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
6399
6527
|
path: new CustomPath2D(),
|
|
6400
6528
|
customPath: function customPath() {
|
|
6401
|
-
|
|
6529
|
+
Logger.getInstance().warn("空函数");
|
|
6402
6530
|
}
|
|
6403
6531
|
});
|
|
6404
6532
|
var DefaultPolygonAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
@@ -6662,7 +6790,7 @@
|
|
|
6662
6790
|
i = 0;
|
|
6663
6791
|
for (; i < verticalList.length && length + verticalList[i].width < width; i++) length += verticalList[i].width, out.push(verticalList[i]);
|
|
6664
6792
|
if (verticalList[i] && verticalList[i].text.length > 1) {
|
|
6665
|
-
var clipedData = this._clipText(verticalList[i].text, options, width - length, 0, verticalList[i].text.length - 1);
|
|
6793
|
+
var clipedData = this._clipText(verticalList[i].text, options, width - length, 0, verticalList[i].text.length - 1, "end", !1);
|
|
6666
6794
|
if (wordBreak && clipedData.str !== verticalList[i].text) {
|
|
6667
6795
|
var text = "",
|
|
6668
6796
|
_length = 0;
|
|
@@ -6701,7 +6829,7 @@
|
|
|
6701
6829
|
str: "",
|
|
6702
6830
|
width: 0
|
|
6703
6831
|
};
|
|
6704
|
-
var data = this._clipText(text, options, width, 0, text.length - 1);
|
|
6832
|
+
var data = this._clipText(text, options, width, 0, text.length - 1, "end", !1);
|
|
6705
6833
|
if (wordBreak && data.str !== text) {
|
|
6706
6834
|
var index = testLetter(text, data.str.length);
|
|
6707
6835
|
index !== data.str.length && (data.str = text.substring(0, index), data.width = this.measureTextWidth(data.str, options));
|
|
@@ -6710,7 +6838,21 @@
|
|
|
6710
6838
|
}
|
|
6711
6839
|
}, {
|
|
6712
6840
|
key: "_clipText",
|
|
6713
|
-
value: function _clipText(text, options, width, leftIdx, rightIdx) {
|
|
6841
|
+
value: function _clipText(text, options, width, leftIdx, rightIdx, position, suffix) {
|
|
6842
|
+
var data;
|
|
6843
|
+
if ("end" === position) data = this._clipTextEnd(text, options, width, leftIdx, rightIdx), suffix && (data.result = data.str + suffix);else if ("start" === position) data = this._clipTextStart(text, options, width, leftIdx, rightIdx), suffix && (data.result = suffix + data.str);else if ("middle" === position) {
|
|
6844
|
+
var d = this._clipTextMiddle(text, options, width, "", "", 0, 0, 1);
|
|
6845
|
+
data = {
|
|
6846
|
+
str: "none",
|
|
6847
|
+
width: d.width,
|
|
6848
|
+
result: d.left + suffix + d.right
|
|
6849
|
+
};
|
|
6850
|
+
}
|
|
6851
|
+
return data;
|
|
6852
|
+
}
|
|
6853
|
+
}, {
|
|
6854
|
+
key: "_clipTextEnd",
|
|
6855
|
+
value: function _clipTextEnd(text, options, width, leftIdx, rightIdx) {
|
|
6714
6856
|
var middleIdx = Math.floor((leftIdx + rightIdx) / 2),
|
|
6715
6857
|
subText = text.substring(0, middleIdx + 1),
|
|
6716
6858
|
strWidth = this.measureTextWidth(subText, options);
|
|
@@ -6724,7 +6866,7 @@
|
|
|
6724
6866
|
return length = this.measureTextWidth(str, options), length <= width ? {
|
|
6725
6867
|
str: str,
|
|
6726
6868
|
width: length
|
|
6727
|
-
} : this.
|
|
6869
|
+
} : this._clipTextEnd(text, options, width, leftIdx, middleIdx);
|
|
6728
6870
|
}
|
|
6729
6871
|
if (strWidth < width) {
|
|
6730
6872
|
if (middleIdx >= text.length - 1) return {
|
|
@@ -6735,16 +6877,68 @@
|
|
|
6735
6877
|
return length = this.measureTextWidth(_str, options), length >= width ? {
|
|
6736
6878
|
str: subText,
|
|
6737
6879
|
width: strWidth
|
|
6738
|
-
} : this.
|
|
6880
|
+
} : this._clipTextEnd(text, options, width, middleIdx, rightIdx);
|
|
6739
6881
|
}
|
|
6740
6882
|
return {
|
|
6741
6883
|
str: subText,
|
|
6742
6884
|
width: strWidth
|
|
6743
6885
|
};
|
|
6744
6886
|
}
|
|
6887
|
+
}, {
|
|
6888
|
+
key: "_clipTextStart",
|
|
6889
|
+
value: function _clipTextStart(text, options, width, leftIdx, rightIdx) {
|
|
6890
|
+
var middleIdx = Math.ceil((leftIdx + rightIdx) / 2),
|
|
6891
|
+
subText = text.substring(middleIdx - 1, text.length - 1),
|
|
6892
|
+
strWidth = this.measureTextWidth(subText, options);
|
|
6893
|
+
var length;
|
|
6894
|
+
if (strWidth > width) {
|
|
6895
|
+
if (subText.length <= 1) return {
|
|
6896
|
+
str: "",
|
|
6897
|
+
width: 0
|
|
6898
|
+
};
|
|
6899
|
+
var str = text.substring(middleIdx, text.length - 1);
|
|
6900
|
+
return length = this.measureTextWidth(str, options), length <= width ? {
|
|
6901
|
+
str: str,
|
|
6902
|
+
width: length
|
|
6903
|
+
} : this._clipTextStart(text, options, width, middleIdx, text.length - 1);
|
|
6904
|
+
}
|
|
6905
|
+
if (strWidth < width) {
|
|
6906
|
+
if (middleIdx <= 0) return {
|
|
6907
|
+
str: text,
|
|
6908
|
+
width: this.measureTextWidth(text, options)
|
|
6909
|
+
};
|
|
6910
|
+
var _str2 = text.substring(middleIdx - 2, text.length - 1);
|
|
6911
|
+
return length = this.measureTextWidth(_str2, options), length >= width ? {
|
|
6912
|
+
str: subText,
|
|
6913
|
+
width: strWidth
|
|
6914
|
+
} : this._clipTextStart(text, options, width, leftIdx, middleIdx);
|
|
6915
|
+
}
|
|
6916
|
+
return {
|
|
6917
|
+
str: subText,
|
|
6918
|
+
width: strWidth
|
|
6919
|
+
};
|
|
6920
|
+
}
|
|
6921
|
+
}, {
|
|
6922
|
+
key: "_clipTextMiddle",
|
|
6923
|
+
value: function _clipTextMiddle(text, options, width, left, right, leftW, rightW, buffer) {
|
|
6924
|
+
var subLeftText = text.substring(0, buffer),
|
|
6925
|
+
strLeftWidth = this.measureTextWidth(subLeftText, options);
|
|
6926
|
+
if (strLeftWidth + rightW > width) return {
|
|
6927
|
+
left: left,
|
|
6928
|
+
right: right,
|
|
6929
|
+
width: leftW + rightW
|
|
6930
|
+
};
|
|
6931
|
+
var subRightText = text.substring(text.length - buffer, text.length),
|
|
6932
|
+
strRightWidth = this.measureTextWidth(subRightText, options);
|
|
6933
|
+
return strLeftWidth + strRightWidth > width ? {
|
|
6934
|
+
left: subLeftText,
|
|
6935
|
+
right: right,
|
|
6936
|
+
width: strLeftWidth + rightW
|
|
6937
|
+
} : this._clipTextMiddle(text, options, width, subLeftText, subRightText, strLeftWidth, strRightWidth, buffer + 1);
|
|
6938
|
+
}
|
|
6745
6939
|
}, {
|
|
6746
6940
|
key: "clipTextWithSuffixVertical",
|
|
6747
|
-
value: function clipTextWithSuffixVertical(verticalList, options, width, suffix, wordBreak) {
|
|
6941
|
+
value: function clipTextWithSuffixVertical(verticalList, options, width, suffix, wordBreak, suffixPosition) {
|
|
6748
6942
|
if ("" === suffix) return this.clipTextVertical(verticalList, options, width, wordBreak);
|
|
6749
6943
|
if (0 === verticalList.length) return {
|
|
6750
6944
|
verticalList: verticalList,
|
|
@@ -6754,17 +6948,50 @@
|
|
|
6754
6948
|
if (output.verticalList.length === verticalList.length && output.verticalList[output.verticalList.length - 1].width === verticalList[verticalList.length - 1].width) return output;
|
|
6755
6949
|
var suffixWidth = this.measureTextWidth(suffix, options);
|
|
6756
6950
|
if (suffixWidth > width) return output;
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6951
|
+
var out;
|
|
6952
|
+
if (width -= suffixWidth, "start" === suffixPosition) {
|
|
6953
|
+
var nextVerticalList = this.revertVerticalList(verticalList);
|
|
6954
|
+
out = this.clipTextVertical(nextVerticalList, options, width, wordBreak);
|
|
6955
|
+
var v = this.revertVerticalList(out.verticalList);
|
|
6956
|
+
v.unshift({
|
|
6957
|
+
text: suffix,
|
|
6958
|
+
direction: 1,
|
|
6959
|
+
width: suffixWidth
|
|
6960
|
+
}), out.verticalList = v;
|
|
6961
|
+
} else if ("middle" === suffixPosition) {
|
|
6962
|
+
var leftOut = this.clipTextVertical(verticalList, options, width / 2, wordBreak),
|
|
6963
|
+
_nextVerticalList = this.revertVerticalList(verticalList),
|
|
6964
|
+
rightOut = this.clipTextVertical(_nextVerticalList, options, width / 2, wordBreak);
|
|
6965
|
+
leftOut.verticalList.push({
|
|
6966
|
+
text: suffix,
|
|
6967
|
+
direction: 1,
|
|
6968
|
+
width: suffixWidth
|
|
6969
|
+
}), this.revertVerticalList(rightOut.verticalList).forEach(function (v) {
|
|
6970
|
+
return leftOut.verticalList.push(v);
|
|
6971
|
+
}), out = {
|
|
6972
|
+
verticalList: leftOut.verticalList,
|
|
6973
|
+
width: leftOut.width + rightOut.width
|
|
6974
|
+
};
|
|
6975
|
+
} else out = this.clipTextVertical(verticalList, options, width, wordBreak), out.verticalList.push({
|
|
6760
6976
|
text: suffix,
|
|
6761
6977
|
direction: 1,
|
|
6762
6978
|
width: suffixWidth
|
|
6763
|
-
})
|
|
6979
|
+
});
|
|
6980
|
+
return out.width += suffixWidth, out;
|
|
6981
|
+
}
|
|
6982
|
+
}, {
|
|
6983
|
+
key: "revertVerticalList",
|
|
6984
|
+
value: function revertVerticalList(verticalList) {
|
|
6985
|
+
return verticalList.reverse().map(function (l) {
|
|
6986
|
+
var t = l.text.split("").reverse().join("");
|
|
6987
|
+
return Object.assign(Object.assign({}, l), {
|
|
6988
|
+
text: t
|
|
6989
|
+
});
|
|
6990
|
+
});
|
|
6764
6991
|
}
|
|
6765
6992
|
}, {
|
|
6766
6993
|
key: "clipTextWithSuffix",
|
|
6767
|
-
value: function clipTextWithSuffix(text, options, width, suffix, wordBreak) {
|
|
6994
|
+
value: function clipTextWithSuffix(text, options, width, suffix, wordBreak, position) {
|
|
6768
6995
|
if ("" === suffix) return this.clipText(text, options, width, wordBreak);
|
|
6769
6996
|
if (0 === text.length) return {
|
|
6770
6997
|
str: "",
|
|
@@ -6781,12 +7008,12 @@
|
|
|
6781
7008
|
width: 0
|
|
6782
7009
|
};
|
|
6783
7010
|
width -= suffixWidth;
|
|
6784
|
-
var data = this._clipText(text, options, width, 0, text.length - 1);
|
|
7011
|
+
var data = this._clipText(text, options, width, 0, text.length - 1, position, suffix);
|
|
6785
7012
|
if (wordBreak && data.str !== text) {
|
|
6786
7013
|
var index = testLetter(text, data.str.length);
|
|
6787
7014
|
index !== data.str.length && (data.str = text.substring(0, index), data.width = this.measureTextWidth(data.str, options));
|
|
6788
7015
|
}
|
|
6789
|
-
return data.str
|
|
7016
|
+
return data.str = data.result, data.width += suffixWidth, data;
|
|
6790
7017
|
}
|
|
6791
7018
|
}]);
|
|
6792
7019
|
return ATextMeasure;
|
|
@@ -7429,7 +7656,7 @@
|
|
|
7429
7656
|
var parentTheme = parentGroup.theme;
|
|
7430
7657
|
(parentTheme.dirty || force) && parentTheme.applyTheme(parentGroup, pt, !0), this.userTheme ? combineTheme(this.userTheme, parentTheme.userTheme, !1) : this.userTheme = clone(parentTheme.userTheme), combineTheme(pt, parentTheme.userTheme);
|
|
7431
7658
|
}
|
|
7432
|
-
this.userTheme ? this.doCombine(pt) : (parentGroup ? this.combinedTheme = parentGroup.theme.combinedTheme : (this.combinedTheme = this._defaultTheme,
|
|
7659
|
+
this.userTheme ? this.doCombine(pt) : (parentGroup ? this.combinedTheme = parentGroup.theme.combinedTheme : (this.combinedTheme = this._defaultTheme, Logger.getInstance().warn("未知错误,走到不应该走的区域里")), this.dirty = !1);
|
|
7433
7660
|
}
|
|
7434
7661
|
return this.combinedTheme;
|
|
7435
7662
|
}
|
|
@@ -7701,7 +7928,7 @@
|
|
|
7701
7928
|
}, {
|
|
7702
7929
|
key: "insertInto",
|
|
7703
7930
|
value: function insertInto(newNode, idx) {
|
|
7704
|
-
if (!this._ignoreWarn && this._nodeList &&
|
|
7931
|
+
if (!this._ignoreWarn && this._nodeList && Logger.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"), idx >= this.childrenCount) return this.appendChild(newNode);
|
|
7705
7932
|
if (this._uid === newNode._uid) return null;
|
|
7706
7933
|
if (newNode.isAncestorsOf(this)) throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");
|
|
7707
7934
|
if (newNode.parent && newNode.parent.removeChild(newNode), newNode.parent = this, 0 === idx) newNode._next = this._firstChild, this._firstChild && (this._firstChild._prev = newNode), newNode._prev = null, this._firstChild = newNode;else {
|
|
@@ -8294,7 +8521,7 @@
|
|
|
8294
8521
|
this.dispatch = new EventEmitter(), this.mappingState = {
|
|
8295
8522
|
trackingData: {}
|
|
8296
8523
|
}, this.eventPool = new Map(), this.onPointerDown = function (from, target) {
|
|
8297
|
-
if (!(from instanceof FederatedPointerEvent)) return void
|
|
8524
|
+
if (!(from instanceof FederatedPointerEvent)) return void Logger.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");
|
|
8298
8525
|
var e = _this.createPointerEvent(from, from.type, target);
|
|
8299
8526
|
if (_this.dispatchEvent(e, "pointerdown"), "touch" === e.pointerType) _this.dispatchEvent(e, "touchstart");else if (isMouseLike(e.pointerType)) {
|
|
8300
8527
|
var isRightButton = 2 === e.button;
|
|
@@ -8303,7 +8530,7 @@
|
|
|
8303
8530
|
_this.trackingData(from.pointerId).pressTargetsByButton[from.button] = e.composedPath(), _this.freeEvent(e);
|
|
8304
8531
|
}, this.onPointerMove = function (from, target) {
|
|
8305
8532
|
var _a, _b;
|
|
8306
|
-
if (!(from instanceof FederatedPointerEvent)) return void
|
|
8533
|
+
if (!(from instanceof FederatedPointerEvent)) return void Logger.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");
|
|
8307
8534
|
var e = _this.createPointerEvent(from, from.type, target),
|
|
8308
8535
|
isMouse = isMouseLike(e.pointerType),
|
|
8309
8536
|
trackingData = _this.trackingData(from.pointerId),
|
|
@@ -8334,7 +8561,7 @@
|
|
|
8334
8561
|
_this.dispatchEvent(e, "pointermove"), "touch" === e.pointerType && _this.dispatchEvent(e, "touchmove"), isMouse && (_this.dispatchEvent(e, "mousemove"), _this.cursor = (null === (_b = null === (_a = e.target) || void 0 === _a ? void 0 : _a.attribute) || void 0 === _b ? void 0 : _b.cursor) || _this.rootTarget.getCursor()), trackingData.overTargets = e.composedPath(), _this.freeEvent(e);
|
|
8335
8562
|
}, this.onPointerOver = function (from, target) {
|
|
8336
8563
|
var _a, _b;
|
|
8337
|
-
if (!(from instanceof FederatedPointerEvent)) return void
|
|
8564
|
+
if (!(from instanceof FederatedPointerEvent)) return void Logger.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");
|
|
8338
8565
|
var trackingData = _this.trackingData(from.pointerId),
|
|
8339
8566
|
e = _this.createPointerEvent(from, from.type, target),
|
|
8340
8567
|
isMouse = isMouseLike(e.pointerType);
|
|
@@ -8343,7 +8570,7 @@
|
|
|
8343
8570
|
for (enterEvent.eventPhase = enterEvent.AT_TARGET; enterEvent.target && enterEvent.target !== _this.rootTarget.parent;) enterEvent.currentTarget = enterEvent.target, _this.notifyTarget(enterEvent), isMouse && _this.notifyTarget(enterEvent, "mouseenter"), enterEvent.target = enterEvent.target.parent;
|
|
8344
8571
|
trackingData.overTargets = e.composedPath(), _this.freeEvent(e), _this.freeEvent(enterEvent);
|
|
8345
8572
|
}, this.onPointerOut = function (from, target) {
|
|
8346
|
-
if (!(from instanceof FederatedPointerEvent)) return void
|
|
8573
|
+
if (!(from instanceof FederatedPointerEvent)) return void Logger.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");
|
|
8347
8574
|
var trackingData = _this.trackingData(from.pointerId);
|
|
8348
8575
|
if (trackingData.overTargets) {
|
|
8349
8576
|
var isMouse = isMouseLike(from.pointerType),
|
|
@@ -8357,7 +8584,7 @@
|
|
|
8357
8584
|
_this.cursor = "";
|
|
8358
8585
|
}, this.onPointerUp = function (from, target) {
|
|
8359
8586
|
var _a;
|
|
8360
|
-
if (!(from instanceof FederatedPointerEvent)) return void
|
|
8587
|
+
if (!(from instanceof FederatedPointerEvent)) return void Logger.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");
|
|
8361
8588
|
var now = clock.now(),
|
|
8362
8589
|
e = _this.createPointerEvent(from, from.type, target);
|
|
8363
8590
|
if (_this.dispatchEvent(e, "pointerup"), "touch" === e.pointerType) _this.dispatchEvent(e, "touchend");else if (isMouseLike(e.pointerType)) {
|
|
@@ -8390,7 +8617,7 @@
|
|
|
8390
8617
|
}
|
|
8391
8618
|
_this.freeEvent(e);
|
|
8392
8619
|
}, this.onPointerUpOutside = function (from, target) {
|
|
8393
|
-
if (!(from instanceof FederatedPointerEvent)) return void
|
|
8620
|
+
if (!(from instanceof FederatedPointerEvent)) return void Logger.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");
|
|
8394
8621
|
var trackingData = _this.trackingData(from.pointerId),
|
|
8395
8622
|
pressTarget = _this.findMountedTarget(trackingData.pressTargetsByButton[from.button]),
|
|
8396
8623
|
e = _this.createPointerEvent(from, from.type, target);
|
|
@@ -8401,7 +8628,7 @@
|
|
|
8401
8628
|
}
|
|
8402
8629
|
_this.freeEvent(e);
|
|
8403
8630
|
}, this.onWheel = function (from, target) {
|
|
8404
|
-
if (!(from instanceof FederatedWheelEvent)) return void
|
|
8631
|
+
if (!(from instanceof FederatedWheelEvent)) return void Logger.getInstance().warn("EventManager cannot map a non-wheel event as a wheel event");
|
|
8405
8632
|
var wheelEvent = _this.createWheelEvent(from, target);
|
|
8406
8633
|
_this.dispatchEvent(wheelEvent), _this.freeEvent(wheelEvent);
|
|
8407
8634
|
}, this.rootTarget = root, this.mappingTable = {}, this._config = Object.assign({
|
|
@@ -8431,7 +8658,7 @@
|
|
|
8431
8658
|
var mappers = this.mappingTable[e.type];
|
|
8432
8659
|
var target;
|
|
8433
8660
|
var cacheKey = "".concat(e.canvasX, "-").concat(e.canvasY);
|
|
8434
|
-
if ((null === (_a = this._prePointTargetCache) || void 0 === _a ? void 0 : _a[cacheKey]) && (null === (_c = null === (_b = this._prePointTargetCache) || void 0 === _b ? void 0 : _b[cacheKey]) || void 0 === _c ? void 0 : _c.stage) && (null === (_e = null === (_d = this._prePointTargetCache) || void 0 === _d ? void 0 : _d[cacheKey]) || void 0 === _e ? void 0 : _e.stage.renderCount) === (null === (_f = this._prePointTargetCache) || void 0 === _f ? void 0 : _f.stageRenderCount) ? target = this._prePointTargetCache[cacheKey] : (target = this.pickTarget(e.canvasX, e.canvasY, e), e.pickParams || (this._prePointTargetCache = _defineProperty(_defineProperty({}, cacheKey, target), "stageRenderCount", null !== (_g = null == target ? void 0 : target.stage.renderCount) && void 0 !== _g ? _g : -1))), mappers) for (var i = 0, j = mappers.length; i < j; i++) mappers[i].fn(e, target);else
|
|
8661
|
+
if ((null === (_a = this._prePointTargetCache) || void 0 === _a ? void 0 : _a[cacheKey]) && (null === (_c = null === (_b = this._prePointTargetCache) || void 0 === _b ? void 0 : _b[cacheKey]) || void 0 === _c ? void 0 : _c.stage) && (null === (_e = null === (_d = this._prePointTargetCache) || void 0 === _d ? void 0 : _d[cacheKey]) || void 0 === _e ? void 0 : _e.stage.renderCount) === (null === (_f = this._prePointTargetCache) || void 0 === _f ? void 0 : _f.stageRenderCount) ? target = this._prePointTargetCache[cacheKey] : (target = this.pickTarget(e.canvasX, e.canvasY, e), e.pickParams || (this._prePointTargetCache = _defineProperty(_defineProperty({}, cacheKey, target), "stageRenderCount", null !== (_g = null == target ? void 0 : target.stage.renderCount) && void 0 !== _g ? _g : -1))), mappers) for (var i = 0, j = mappers.length; i < j; i++) mappers[i].fn(e, target);else Logger.getInstance().warn("[EventManager]: Event mapping not defined for ".concat(e.type));
|
|
8435
8662
|
}
|
|
8436
8663
|
}, {
|
|
8437
8664
|
key: "propagate",
|
|
@@ -8961,7 +9188,7 @@
|
|
|
8961
9188
|
handler = new ManualTickHandler();
|
|
8962
9189
|
break;
|
|
8963
9190
|
default:
|
|
8964
|
-
|
|
9191
|
+
Logger.getInstance().warn("非法的计时器模式"), handler = new RAFTickHandler();
|
|
8965
9192
|
}
|
|
8966
9193
|
return !!handler.avaliable() && (this.tickerHandler && this.tickerHandler.release(), this.tickerHandler = handler, !0);
|
|
8967
9194
|
}
|
|
@@ -9800,7 +10027,7 @@
|
|
|
9800
10027
|
}
|
|
9801
10028
|
lastStep = lastStep.prev;
|
|
9802
10029
|
}
|
|
9803
|
-
return
|
|
10030
|
+
return Logger.getInstance().warn("未知错误,step中找不到属性"), step.props[name];
|
|
9804
10031
|
}
|
|
9805
10032
|
}, {
|
|
9806
10033
|
key: "updateTarget",
|
|
@@ -10229,6 +10456,19 @@
|
|
|
10229
10456
|
}, {
|
|
10230
10457
|
key: "onStart",
|
|
10231
10458
|
value: function onStart() {
|
|
10459
|
+
this.target && ("rect" === this.target.type ? this.onStartRect() : "line" === this.target.type ? this.onStartLineOrArea("line") : "area" === this.target.type && this.onStartLineOrArea("area"));
|
|
10460
|
+
}
|
|
10461
|
+
}, {
|
|
10462
|
+
key: "onStartLineOrArea",
|
|
10463
|
+
value: function onStartLineOrArea(type) {
|
|
10464
|
+
var _a;
|
|
10465
|
+
var root = this.target.attachShadow(),
|
|
10466
|
+
line = application.graphicService.creator[type](Object.assign({}, null === (_a = this.params) || void 0 === _a ? void 0 : _a.attribute));
|
|
10467
|
+
this[type] = line, line.pathProxy = new CustomPath2D(), root.add(line);
|
|
10468
|
+
}
|
|
10469
|
+
}, {
|
|
10470
|
+
key: "onStartRect",
|
|
10471
|
+
value: function onStartRect() {
|
|
10232
10472
|
var _a;
|
|
10233
10473
|
var root = this.target.attachShadow(),
|
|
10234
10474
|
height = this.target.AABBBounds.height(),
|
|
@@ -10255,6 +10495,11 @@
|
|
|
10255
10495
|
}, {
|
|
10256
10496
|
key: "onUpdate",
|
|
10257
10497
|
value: function onUpdate(end, ratio, out) {
|
|
10498
|
+
return this.rect ? this.onUpdateRect(end, ratio, out) : this.line || this.area ? this.onUpdateLineOrArea(end, ratio, out) : void 0;
|
|
10499
|
+
}
|
|
10500
|
+
}, {
|
|
10501
|
+
key: "onUpdateRect",
|
|
10502
|
+
value: function onUpdateRect(end, ratio, out) {
|
|
10258
10503
|
var _a, _b, _c, _d, _e, _f;
|
|
10259
10504
|
var parentWidth = null !== (_a = this.target.attribute.width) && void 0 !== _a ? _a : 250,
|
|
10260
10505
|
streamLength = null !== (_c = null === (_b = this.params) || void 0 === _b ? void 0 : _b.streamLength) && void 0 !== _c ? _c : parentWidth,
|
|
@@ -10275,6 +10520,114 @@
|
|
|
10275
10520
|
}
|
|
10276
10521
|
});
|
|
10277
10522
|
}
|
|
10523
|
+
}, {
|
|
10524
|
+
key: "onUpdateLineOrArea",
|
|
10525
|
+
value: function onUpdateLineOrArea(end, ratio, out) {
|
|
10526
|
+
var target = this.line || this.area;
|
|
10527
|
+
if (!target) return;
|
|
10528
|
+
var customPath = target.pathProxy,
|
|
10529
|
+
targetLine = this.target;
|
|
10530
|
+
targetLine.cache || targetLine.cacheArea ? this._onUpdateLineOrAreaWithCache(customPath, targetLine, end, ratio, out) : this._onUpdateLineWithoutCache(customPath, targetLine, end, ratio, out);
|
|
10531
|
+
var targetAttrs = targetLine.attribute;
|
|
10532
|
+
target.setAttributes(Object.assign({
|
|
10533
|
+
stroke: targetAttrs.stroke
|
|
10534
|
+
}, target.attribute)), target.addUpdateBoundTag();
|
|
10535
|
+
}
|
|
10536
|
+
}, {
|
|
10537
|
+
key: "_onUpdateLineOrAreaWithCache",
|
|
10538
|
+
value: function _onUpdateLineOrAreaWithCache(customPath, g, end, ratio, out) {
|
|
10539
|
+
if (customPath.clear(), "line" === g.type) {
|
|
10540
|
+
var cache = g.cache;
|
|
10541
|
+
Array.isArray(cache) || (cache = [cache]);
|
|
10542
|
+
var totalLen = cache.reduce(function (l, c) {
|
|
10543
|
+
return l + c.getLength();
|
|
10544
|
+
}, 0),
|
|
10545
|
+
curves = [];
|
|
10546
|
+
return cache.forEach(function (c) {
|
|
10547
|
+
c.curves.forEach(function (ci) {
|
|
10548
|
+
return curves.push(ci);
|
|
10549
|
+
});
|
|
10550
|
+
}), this._updateCurves(customPath, curves, totalLen, ratio);
|
|
10551
|
+
}
|
|
10552
|
+
if ("area" === g.type) {
|
|
10553
|
+
var _cache = g.cacheArea,
|
|
10554
|
+
_totalLen = _cache.top.curves.reduce(function (a, b) {
|
|
10555
|
+
return a + b.getLength();
|
|
10556
|
+
}, 0);
|
|
10557
|
+
return this._updateCurves(customPath, _cache.top.curves, _totalLen, ratio);
|
|
10558
|
+
}
|
|
10559
|
+
}
|
|
10560
|
+
}, {
|
|
10561
|
+
key: "_updateCurves",
|
|
10562
|
+
value: function _updateCurves(customPath, curves, totalLen, ratio) {
|
|
10563
|
+
var _a, _b;
|
|
10564
|
+
var startLen = totalLen * ratio,
|
|
10565
|
+
endLen = Math.min(null !== (_b = startLen + (null === (_a = this.params) || void 0 === _a ? void 0 : _a.streamLength)) && void 0 !== _b ? _b : 10, totalLen);
|
|
10566
|
+
var lastLen = 0,
|
|
10567
|
+
start = !1;
|
|
10568
|
+
for (var i = 0; i < curves.length; i++) {
|
|
10569
|
+
var curveItem = curves[i],
|
|
10570
|
+
len = curveItem.getLength(),
|
|
10571
|
+
startPercent = 1 - (lastLen + len - startLen) / len;
|
|
10572
|
+
var curveForStart = void 0,
|
|
10573
|
+
endPercent = 1 - (lastLen + len - endLen) / len;
|
|
10574
|
+
if (lastLen < startLen && lastLen + len > startLen) if (start = !0, curveItem.p2 && curveItem.p3) {
|
|
10575
|
+
var _divideCubic = divideCubic(curveItem, startPercent),
|
|
10576
|
+
_divideCubic2 = _slicedToArray(_divideCubic, 2);
|
|
10577
|
+
_divideCubic2[0];
|
|
10578
|
+
var curve2 = _divideCubic2[1];
|
|
10579
|
+
customPath.moveTo(curve2.p0.x, curve2.p0.y), curveForStart = curve2;
|
|
10580
|
+
} else {
|
|
10581
|
+
var p = curveItem.getPointAt(startPercent);
|
|
10582
|
+
customPath.moveTo(p.x, p.y);
|
|
10583
|
+
}
|
|
10584
|
+
if (lastLen < endLen && lastLen + len > endLen) {
|
|
10585
|
+
if (curveItem.p2 && curveItem.p3) {
|
|
10586
|
+
curveForStart && (endPercent = (endLen - startLen) / curveForStart.getLength());
|
|
10587
|
+
var _divideCubic3 = divideCubic(curveForStart || curveItem, endPercent),
|
|
10588
|
+
_divideCubic4 = _slicedToArray(_divideCubic3, 1),
|
|
10589
|
+
curve1 = _divideCubic4[0];
|
|
10590
|
+
customPath.bezierCurveTo(curve1.p1.x, curve1.p1.y, curve1.p2.x, curve1.p2.y, curve1.p3.x, curve1.p3.y);
|
|
10591
|
+
} else {
|
|
10592
|
+
var _p = curveItem.getPointAt(endPercent);
|
|
10593
|
+
customPath.lineTo(_p.x, _p.y);
|
|
10594
|
+
}
|
|
10595
|
+
break;
|
|
10596
|
+
}
|
|
10597
|
+
if (start) if (curveItem.p2 && curveItem.p3) {
|
|
10598
|
+
var curve = curveForStart || curveItem;
|
|
10599
|
+
customPath.bezierCurveTo(curve.p1.x, curve.p1.y, curve.p2.x, curve.p2.y, curve.p3.x, curve.p3.y);
|
|
10600
|
+
} else customPath.lineTo(curveItem.p1.x, curveItem.p1.y);
|
|
10601
|
+
lastLen += len;
|
|
10602
|
+
}
|
|
10603
|
+
}
|
|
10604
|
+
}, {
|
|
10605
|
+
key: "_onUpdateLineWithoutCache",
|
|
10606
|
+
value: function _onUpdateLineWithoutCache(customPath, line, end, ratio, out) {
|
|
10607
|
+
var _a, _b;
|
|
10608
|
+
var _line$attribute = line.attribute,
|
|
10609
|
+
points = _line$attribute.points,
|
|
10610
|
+
curveType = _line$attribute.curveType;
|
|
10611
|
+
if (!points || points.length < 2 || "linear" !== curveType) return;
|
|
10612
|
+
var totalLen = 0;
|
|
10613
|
+
for (var i = 1; i < points.length; i++) totalLen += PointService.distancePP(points[i], points[i - 1]);
|
|
10614
|
+
var startLen = totalLen * ratio,
|
|
10615
|
+
endLen = Math.min(null !== (_b = startLen + (null === (_a = this.params) || void 0 === _a ? void 0 : _a.streamLength)) && void 0 !== _b ? _b : 10, totalLen),
|
|
10616
|
+
nextPoints = [];
|
|
10617
|
+
var lastLen = 0;
|
|
10618
|
+
for (var _i = 1; _i < points.length; _i++) {
|
|
10619
|
+
var len = PointService.distancePP(points[_i], points[_i - 1]);
|
|
10620
|
+
if (lastLen < startLen && lastLen + len > startLen && nextPoints.push(PointService.pointAtPP(points[_i - 1], points[_i], 1 - (lastLen + len - startLen) / len)), lastLen < endLen && lastLen + len > endLen) {
|
|
10621
|
+
nextPoints.push(PointService.pointAtPP(points[_i - 1], points[_i], 1 - (lastLen + len - endLen) / len));
|
|
10622
|
+
break;
|
|
10623
|
+
}
|
|
10624
|
+
nextPoints.length && nextPoints.push(points[_i]), lastLen += len;
|
|
10625
|
+
}
|
|
10626
|
+
if (nextPoints.length && !(nextPoints.length < 2)) {
|
|
10627
|
+
customPath.clear(), customPath.moveTo(nextPoints[0].x, nextPoints[0].y);
|
|
10628
|
+
for (var _i2 = 1; _i2 < nextPoints.length; _i2++) customPath.lineTo(nextPoints[_i2].x, nextPoints[_i2].y);
|
|
10629
|
+
}
|
|
10630
|
+
}
|
|
10278
10631
|
}]);
|
|
10279
10632
|
return StreamLight;
|
|
10280
10633
|
}(ACustomAnimate);
|
|
@@ -10384,8 +10737,8 @@
|
|
|
10384
10737
|
firstMatchedIndex = i, firstMatchedPoint = tagMap.get(this.toPoints[i].context);
|
|
10385
10738
|
break;
|
|
10386
10739
|
}
|
|
10387
|
-
for (var
|
|
10388
|
-
lastMatchedIndex =
|
|
10740
|
+
for (var _i3 = this.toPoints.length - 1; _i3 >= 0; _i3 -= 1) if (tagMap.has(this.toPoints[_i3].context)) {
|
|
10741
|
+
lastMatchedIndex = _i3, lastMatchedPoint = tagMap.get(this.toPoints[_i3].context);
|
|
10389
10742
|
break;
|
|
10390
10743
|
}
|
|
10391
10744
|
var prevMatchedPoint = this.toPoints[0];
|
|
@@ -12729,6 +13082,7 @@
|
|
|
12729
13082
|
if (!animate.validAttr(key)) return;
|
|
12730
13083
|
var nextStepVal = nextProps[key],
|
|
12731
13084
|
lastStepVal = null !== (_a = lastProps && lastProps[key]) && void 0 !== _a ? _a : subAnimate.getLastPropByName(key, step);
|
|
13085
|
+
if (null == nextStepVal || null == lastStepVal) return void (nextAttributes[key] = nextStepVal);
|
|
12732
13086
|
var match;
|
|
12733
13087
|
match = animate.interpolateFunc && animate.interpolateFunc(key, ratio, lastStepVal, nextStepVal, nextAttributes), match || (match = animate.customInterpolate(key, ratio, lastStepVal, nextStepVal, _this7, nextAttributes), match || _this7.defaultInterpolate(nextStepVal, lastStepVal, key, nextAttributes, nextParsedProps, ratio) || _this7._interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes));
|
|
12734
13088
|
}), step.parsedProps = nextParsedProps;
|
|
@@ -14445,12 +14799,12 @@
|
|
|
14445
14799
|
}
|
|
14446
14800
|
}, {
|
|
14447
14801
|
key: "GetLayout",
|
|
14448
|
-
value: function GetLayout(str, width, height, textAlign, textBaseline, lineHeight, suffix, wordBreak,
|
|
14802
|
+
value: function GetLayout(str, width, height, textAlign, textBaseline, lineHeight, suffix, wordBreak, suffixPosition) {
|
|
14449
14803
|
var linesLayout = [],
|
|
14450
14804
|
bboxWH = [width, height],
|
|
14451
14805
|
bboxOffset = [0, 0];
|
|
14452
14806
|
for (; str.length > 0;) {
|
|
14453
|
-
var _this$textMeasure$cli = this.textMeasure.clipTextWithSuffix(str, this.textOptions, width, suffix, wordBreak),
|
|
14807
|
+
var _this$textMeasure$cli = this.textMeasure.clipTextWithSuffix(str, this.textOptions, width, suffix, wordBreak, suffixPosition),
|
|
14454
14808
|
clipText = _this$textMeasure$cli.str;
|
|
14455
14809
|
linesLayout.push({
|
|
14456
14810
|
str: clipText,
|
|
@@ -14472,6 +14826,7 @@
|
|
|
14472
14826
|
var suffix = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "";
|
|
14473
14827
|
var wordBreak = arguments.length > 5 ? arguments[5] : undefined;
|
|
14474
14828
|
var lineWidth = arguments.length > 6 ? arguments[6] : undefined;
|
|
14829
|
+
var suffixPosition = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : "end";
|
|
14475
14830
|
lines = lines.map(function (l) {
|
|
14476
14831
|
return l.toString();
|
|
14477
14832
|
});
|
|
@@ -14480,7 +14835,7 @@
|
|
|
14480
14835
|
if ("number" == typeof lineWidth && lineWidth !== 1 / 0) {
|
|
14481
14836
|
var width;
|
|
14482
14837
|
for (var i = 0, len = lines.length; i < len; i++) width = Math.min(this.textMeasure.measureTextWidth(lines[i], this.textOptions), lineWidth), linesLayout.push({
|
|
14483
|
-
str: this.textMeasure.clipTextWithSuffix(lines[i], this.textOptions, width, suffix, wordBreak).str,
|
|
14838
|
+
str: this.textMeasure.clipTextWithSuffix(lines[i], this.textOptions, width, suffix, wordBreak, suffixPosition).str,
|
|
14484
14839
|
width: width
|
|
14485
14840
|
});
|
|
14486
14841
|
bboxWH[0] = lineWidth;
|
|
@@ -14758,12 +15113,12 @@
|
|
|
14758
15113
|
stroke = _attribute$stroke === void 0 ? textTheme.stroke : _attribute$stroke,
|
|
14759
15114
|
_attribute$lineWidth = attribute.lineWidth,
|
|
14760
15115
|
lineWidth = _attribute$lineWidth === void 0 ? textTheme.lineWidth : _attribute$lineWidth,
|
|
14761
|
-
_attribute$
|
|
14762
|
-
_attribute$wordBreak === void 0 ? textTheme.wordBreak : _attribute$wordBreak;
|
|
14763
|
-
var _attribute$ignoreBuf = attribute.ignoreBuf,
|
|
15116
|
+
_attribute$ignoreBuf = attribute.ignoreBuf,
|
|
14764
15117
|
ignoreBuf = _attribute$ignoreBuf === void 0 ? textTheme.ignoreBuf : _attribute$ignoreBuf,
|
|
14765
15118
|
_attribute$whiteSpace = attribute.whiteSpace,
|
|
14766
|
-
whiteSpace = _attribute$whiteSpace === void 0 ? textTheme.whiteSpace : _attribute$whiteSpace
|
|
15119
|
+
whiteSpace = _attribute$whiteSpace === void 0 ? textTheme.whiteSpace : _attribute$whiteSpace,
|
|
15120
|
+
_attribute$suffixPosi = attribute.suffixPosition,
|
|
15121
|
+
suffixPosition = _attribute$suffixPosi === void 0 ? textTheme.suffixPosition : _attribute$suffixPosi;
|
|
14767
15122
|
if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
|
|
14768
15123
|
var buf = ignoreBuf ? 0 : Math.max(2, .075 * fontSize),
|
|
14769
15124
|
textFontSize = attribute.fontSize || textTheme.fontSize,
|
|
@@ -14781,7 +15136,7 @@
|
|
|
14781
15136
|
fontSize: fontSize,
|
|
14782
15137
|
fontWeight: fontWeight,
|
|
14783
15138
|
fontFamily: fontFamily
|
|
14784
|
-
}, maxLineWidth, strEllipsis, !1);
|
|
15139
|
+
}, maxLineWidth, strEllipsis, !1, suffixPosition);
|
|
14785
15140
|
str = data.str, width = data.width;
|
|
14786
15141
|
} else {
|
|
14787
15142
|
var _data = textMeasure.clipText(text.toString(), {
|
|
@@ -14841,6 +15196,8 @@
|
|
|
14841
15196
|
lineWidth = _attribute$lineWidth2 === void 0 ? textTheme.lineWidth : _attribute$lineWidth2,
|
|
14842
15197
|
_attribute$verticalMo = attribute.verticalMode,
|
|
14843
15198
|
verticalMode = _attribute$verticalMo === void 0 ? textTheme.verticalMode : _attribute$verticalMo,
|
|
15199
|
+
_attribute$suffixPosi2 = attribute.suffixPosition,
|
|
15200
|
+
suffixPosition = _attribute$suffixPosi2 === void 0 ? textTheme.suffixPosition : _attribute$suffixPosi2,
|
|
14844
15201
|
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
14845
15202
|
var _attribute$textAlign2 = attribute.textAlign,
|
|
14846
15203
|
textAlign = _attribute$textAlign2 === void 0 ? textTheme.textAlign : _attribute$textAlign2,
|
|
@@ -14864,7 +15221,7 @@
|
|
|
14864
15221
|
fontSize: fontSize,
|
|
14865
15222
|
fontWeight: fontWeight,
|
|
14866
15223
|
fontFamily: fontFamily
|
|
14867
|
-
}, maxLineWidth, strEllipsis, !1);
|
|
15224
|
+
}, maxLineWidth, strEllipsis, !1, suffixPosition);
|
|
14868
15225
|
verticalList = [data.verticalList], width = data.width;
|
|
14869
15226
|
} else {
|
|
14870
15227
|
var _data2 = textMeasure.clipTextVertical(verticalList[0], {
|
|
@@ -14913,6 +15270,8 @@
|
|
|
14913
15270
|
lineWidth = _attribute$lineWidth3 === void 0 ? textTheme.lineWidth : _attribute$lineWidth3,
|
|
14914
15271
|
_attribute$whiteSpace2 = attribute.whiteSpace,
|
|
14915
15272
|
whiteSpace = _attribute$whiteSpace2 === void 0 ? textTheme.whiteSpace : _attribute$whiteSpace2,
|
|
15273
|
+
_attribute$suffixPosi3 = attribute.suffixPosition,
|
|
15274
|
+
suffixPosition = _attribute$suffixPosi3 === void 0 ? textTheme.suffixPosition : _attribute$suffixPosi3,
|
|
14916
15275
|
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : attribute.fontSize || textTheme.fontSize;
|
|
14917
15276
|
if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
|
|
14918
15277
|
if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
|
|
@@ -14924,7 +15283,7 @@
|
|
|
14924
15283
|
fontSize: fontSize,
|
|
14925
15284
|
fontWeight: fontWeight,
|
|
14926
15285
|
fontFamily: fontFamily
|
|
14927
|
-
}, textMeasure).GetLayoutByLines(text, textAlign, textBaseline, lineHeight, !0 === ellipsis ? textTheme.ellipsis : ellipsis || void 0, !1, maxLineWidth),
|
|
15286
|
+
}, textMeasure).GetLayoutByLines(text, textAlign, textBaseline, lineHeight, !0 === ellipsis ? textTheme.ellipsis : ellipsis || void 0, !1, maxLineWidth, suffixPosition),
|
|
14928
15287
|
bbox = layoutData.bbox;
|
|
14929
15288
|
return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
14930
15289
|
}
|
|
@@ -14955,6 +15314,8 @@
|
|
|
14955
15314
|
lineWidth = _attribute$lineWidth4 === void 0 ? textTheme.lineWidth : _attribute$lineWidth4,
|
|
14956
15315
|
_attribute$verticalMo2 = attribute.verticalMode,
|
|
14957
15316
|
verticalMode = _attribute$verticalMo2 === void 0 ? textTheme.verticalMode : _attribute$verticalMo2,
|
|
15317
|
+
_attribute$suffixPosi4 = attribute.suffixPosition,
|
|
15318
|
+
suffixPosition = _attribute$suffixPosi4 === void 0 ? textTheme.suffixPosition : _attribute$suffixPosi4,
|
|
14958
15319
|
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
14959
15320
|
var _attribute$textAlign4 = attribute.textAlign,
|
|
14960
15321
|
textAlign = _attribute$textAlign4 === void 0 ? textTheme.textAlign : _attribute$textAlign4,
|
|
@@ -14987,7 +15348,7 @@
|
|
|
14987
15348
|
fontSize: fontSize,
|
|
14988
15349
|
fontWeight: fontWeight,
|
|
14989
15350
|
fontFamily: fontFamily
|
|
14990
|
-
}, maxLineWidth, strEllipsis, !1);
|
|
15351
|
+
}, maxLineWidth, strEllipsis, !1, suffixPosition);
|
|
14991
15352
|
verticalLists[i] = data.verticalList, width = data.width;
|
|
14992
15353
|
} else {
|
|
14993
15354
|
var _data3 = textMeasure.clipTextVertical(verticalData, {
|
|
@@ -16123,6 +16484,7 @@
|
|
|
16123
16484
|
}, {
|
|
16124
16485
|
key: "_isValid",
|
|
16125
16486
|
value: function _isValid() {
|
|
16487
|
+
if (this.pathProxy) return !0;
|
|
16126
16488
|
var _this$attribute = this.attribute,
|
|
16127
16489
|
points = _this$attribute.points,
|
|
16128
16490
|
segments = _this$attribute.segments;
|
|
@@ -17431,6 +17793,7 @@
|
|
|
17431
17793
|
}, {
|
|
17432
17794
|
key: "_isValid",
|
|
17433
17795
|
value: function _isValid() {
|
|
17796
|
+
if (this.pathProxy) return !0;
|
|
17434
17797
|
var _this$attribute = this.attribute,
|
|
17435
17798
|
points = _this$attribute.points,
|
|
17436
17799
|
segments = _this$attribute.segments;
|
|
@@ -18842,17 +19205,23 @@
|
|
|
18842
19205
|
shadowBlur = _attribute$shadowBlur2 === void 0 ? theme.shadowBlur : _attribute$shadowBlur2,
|
|
18843
19206
|
_attribute$lineWidth = attribute.lineWidth,
|
|
18844
19207
|
lineWidth = _attribute$lineWidth === void 0 ? theme.lineWidth : _attribute$lineWidth,
|
|
19208
|
+
_attribute$pickStroke = attribute.pickStrokeBuffer,
|
|
19209
|
+
pickStrokeBuffer = _attribute$pickStroke === void 0 ? theme.pickStrokeBuffer : _attribute$pickStroke,
|
|
18845
19210
|
_attribute$strokeBoun2 = attribute.strokeBoundsBuffer,
|
|
18846
19211
|
strokeBoundsBuffer = _attribute$strokeBoun2 === void 0 ? theme.strokeBoundsBuffer : _attribute$strokeBoun2,
|
|
18847
19212
|
tb1 = this.tempAABBBounds1,
|
|
18848
19213
|
tb2 = this.tempAABBBounds2;
|
|
18849
19214
|
if (stroke) {
|
|
18850
|
-
var scaledHalfLineWidth = lineWidth / Math.abs(scaleX + scaleY);
|
|
19215
|
+
var scaledHalfLineWidth = (lineWidth + pickStrokeBuffer) / Math.abs(scaleX + scaleY);
|
|
18851
19216
|
boundStroke(tb1, scaledHalfLineWidth, miter, strokeBoundsBuffer), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
|
|
18852
19217
|
}
|
|
18853
19218
|
if (shadowBlur) {
|
|
18854
|
-
var
|
|
18855
|
-
|
|
19219
|
+
var _attribute$shadowOffs = attribute.shadowOffsetX,
|
|
19220
|
+
shadowOffsetX = _attribute$shadowOffs === void 0 ? theme.shadowOffsetX : _attribute$shadowOffs,
|
|
19221
|
+
_attribute$shadowOffs2 = attribute.shadowOffsetY,
|
|
19222
|
+
shadowOffsetY = _attribute$shadowOffs2 === void 0 ? theme.shadowOffsetY : _attribute$shadowOffs2,
|
|
19223
|
+
shadowBlurWidth = shadowBlur / Math.abs(scaleX + scaleY) * 2 + Math.max(shadowOffsetX, shadowOffsetY);
|
|
19224
|
+
boundStroke(tb1, shadowBlurWidth, miter, strokeBoundsBuffer + 1), aabbBounds.union(tb1);
|
|
18856
19225
|
}
|
|
18857
19226
|
this.combindShadowAABBBounds(aabbBounds, graphic), transformBoundsWithMatrix(aabbBounds, aabbBounds, graphic.transMatrix);
|
|
18858
19227
|
}
|
|
@@ -22928,7 +23297,7 @@
|
|
|
22928
23297
|
}, {
|
|
22929
23298
|
key: "selectRenderByType",
|
|
22930
23299
|
value: function selectRenderByType(type) {
|
|
22931
|
-
return
|
|
23300
|
+
return Logger.getInstance().warn("未知错误,不应该走到这里"), null;
|
|
22932
23301
|
}
|
|
22933
23302
|
}, {
|
|
22934
23303
|
key: "selectRenderByNumberType",
|
|
@@ -30795,7 +31164,7 @@
|
|
|
30795
31164
|
}, {
|
|
30796
31165
|
key: "reset",
|
|
30797
31166
|
value: function reset() {
|
|
30798
|
-
this.stack.length &&
|
|
31167
|
+
this.stack.length && Logger.getInstance().warn("可能存在bug,matrix没有清空"), this.matrix.setValue(1, 0, 0, 1, 0, 0), this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack.length = 0, this.nativeContext.setTransform(1, 0, 0, 1, 0, 0);
|
|
30799
31168
|
}
|
|
30800
31169
|
}, {
|
|
30801
31170
|
key: "getCanvas",
|
|
@@ -31577,8 +31946,9 @@
|
|
|
31577
31946
|
return !!picked || (picked = context.isPointInPath(point.x, point.y), picked);
|
|
31578
31947
|
}, function (context, circleAttribute, themeAttribute) {
|
|
31579
31948
|
if (picked) return !0;
|
|
31580
|
-
var lineWidth = circleAttribute.lineWidth || themeAttribute.lineWidth
|
|
31581
|
-
|
|
31949
|
+
var lineWidth = circleAttribute.lineWidth || themeAttribute.lineWidth,
|
|
31950
|
+
pickStrokeBuffer = circleAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
|
|
31951
|
+
return pickContext.lineWidth = getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
|
|
31582
31952
|
}), pickContext.highPerformanceRestore(), picked;
|
|
31583
31953
|
}
|
|
31584
31954
|
}]);
|
|
@@ -31636,8 +32006,9 @@
|
|
|
31636
32006
|
return !!picked || (picked = context.isPointInPath(point.x, point.y), picked);
|
|
31637
32007
|
}, function (context, rectAttribute, themeAttribute) {
|
|
31638
32008
|
if (picked) return !0;
|
|
31639
|
-
var lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth
|
|
31640
|
-
|
|
32009
|
+
var lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth,
|
|
32010
|
+
pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
|
|
32011
|
+
return pickContext.lineWidth = getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
|
|
31641
32012
|
});else {
|
|
31642
32013
|
var _rect$attribute2 = rect.attribute,
|
|
31643
32014
|
_rect$attribute2$fill = _rect$attribute2.fill,
|
|
@@ -31702,8 +32073,9 @@
|
|
|
31702
32073
|
return !!picked || (picked = context.isPointInPath(point.x, point.y), picked);
|
|
31703
32074
|
}, function (context, arcAttribute, themeAttribute) {
|
|
31704
32075
|
if (picked) return !0;
|
|
31705
|
-
var lineWidth = arcAttribute.lineWidth || themeAttribute.lineWidth
|
|
31706
|
-
|
|
32076
|
+
var lineWidth = arcAttribute.lineWidth || themeAttribute.lineWidth,
|
|
32077
|
+
pickStrokeBuffer = arcAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
|
|
32078
|
+
return pickContext.lineWidth = getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
|
|
31707
32079
|
}), pickContext.highPerformanceRestore(), picked;
|
|
31708
32080
|
}
|
|
31709
32081
|
}]);
|
|
@@ -31850,10 +32222,11 @@
|
|
|
31850
32222
|
var picked = !1;
|
|
31851
32223
|
return this.canvasRenderer.drawShape(line, pickContext, x, y, {}, null, function (context) {
|
|
31852
32224
|
return !!picked || (picked = context.isPointInPath(pickPoint.x, pickPoint.y), picked);
|
|
31853
|
-
}, function (context,
|
|
32225
|
+
}, function (context, lineAttribute, themeAttribute) {
|
|
31854
32226
|
if (picked) return !0;
|
|
31855
|
-
var lineWidth =
|
|
31856
|
-
|
|
32227
|
+
var lineWidth = lineAttribute.lineWidth || themeAttribute.lineWidth,
|
|
32228
|
+
pickStrokeBuffer = lineAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
|
|
32229
|
+
return pickContext.lineWidth = getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
|
|
31857
32230
|
}), this.canvasRenderer.z = 0, pickContext.modelMatrix !== lastModelMatrix && mat4Allocate.free(pickContext.modelMatrix), pickContext.modelMatrix = lastModelMatrix, pickContext.highPerformanceRestore(), picked;
|
|
31858
32231
|
}
|
|
31859
32232
|
}]);
|
|
@@ -31912,8 +32285,9 @@
|
|
|
31912
32285
|
return !!picked || (picked = context.isPointInPath(pickPoint.x, pickPoint.y), picked);
|
|
31913
32286
|
}, function (context, pathAttribute, themeAttribute) {
|
|
31914
32287
|
if (picked) return !0;
|
|
31915
|
-
var lineWidth = pathAttribute.lineWidth || themeAttribute.lineWidth
|
|
31916
|
-
|
|
32288
|
+
var lineWidth = pathAttribute.lineWidth || themeAttribute.lineWidth,
|
|
32289
|
+
pickStrokeBuffer = pathAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
|
|
32290
|
+
return pickContext.lineWidth = getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
|
|
31917
32291
|
}), this.canvasRenderer.z = 0, pickContext.modelMatrix !== lastModelMatrix && mat4Allocate.free(pickContext.modelMatrix), pickContext.modelMatrix = lastModelMatrix, pickContext.highPerformanceRestore(), picked;
|
|
31918
32292
|
}
|
|
31919
32293
|
}]);
|
|
@@ -31975,8 +32349,9 @@
|
|
|
31975
32349
|
return !!picked || (picked = context.isPointInPath(pickPoint.x, pickPoint.y), picked);
|
|
31976
32350
|
}, function (context, symbolAttribute, themeAttribute) {
|
|
31977
32351
|
if (picked) return !0;
|
|
31978
|
-
var lineWidth = symbolAttribute.lineWidth || themeAttribute.lineWidth
|
|
31979
|
-
|
|
32352
|
+
var lineWidth = symbolAttribute.lineWidth || themeAttribute.lineWidth,
|
|
32353
|
+
pickStrokeBuffer = symbolAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
|
|
32354
|
+
return pickContext.lineWidth = getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
|
|
31980
32355
|
}), this.canvasRenderer.z = 0, pickContext.modelMatrix !== lastModelMatrix && mat4Allocate.free(pickContext.modelMatrix), pickContext.modelMatrix = lastModelMatrix, pickContext.highPerformanceRestore(), picked;
|
|
31981
32356
|
}
|
|
31982
32357
|
}]);
|
|
@@ -32101,8 +32476,9 @@
|
|
|
32101
32476
|
return !!picked || (picked = context.isPointInPath(point.x, point.y), picked);
|
|
32102
32477
|
}, function (context, pathAttribute, themeAttribute) {
|
|
32103
32478
|
if (picked) return !0;
|
|
32104
|
-
var lineWidth = pathAttribute.lineWidth || themeAttribute.lineWidth
|
|
32105
|
-
|
|
32479
|
+
var lineWidth = pathAttribute.lineWidth || themeAttribute.lineWidth,
|
|
32480
|
+
pickStrokeBuffer = pathAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
|
|
32481
|
+
return pickContext.lineWidth = getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
|
|
32106
32482
|
}), pickContext.highPerformanceRestore(), picked;
|
|
32107
32483
|
}
|
|
32108
32484
|
}]);
|
|
@@ -33026,8 +33402,9 @@
|
|
|
33026
33402
|
return !!picked || (picked = context.isPointInPath(point.x, point.y), picked);
|
|
33027
33403
|
}, function (context, pathAttribute, themeAttribute) {
|
|
33028
33404
|
if (picked) return !0;
|
|
33029
|
-
var lineWidth = pathAttribute.lineWidth || themeAttribute.lineWidth
|
|
33030
|
-
|
|
33405
|
+
var lineWidth = pathAttribute.lineWidth || themeAttribute.lineWidth,
|
|
33406
|
+
pickStrokeBuffer = pathAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
|
|
33407
|
+
return pickContext.lineWidth = lineWidth + pickStrokeBuffer, picked = context.isPointInStroke(point.x, point.y), picked;
|
|
33031
33408
|
}), pickContext.highPerformanceRestore(), picked;
|
|
33032
33409
|
}
|
|
33033
33410
|
}]);
|
|
@@ -33078,8 +33455,9 @@
|
|
|
33078
33455
|
return !!picked || (picked = context.isPointInPath(point.x, point.y), picked);
|
|
33079
33456
|
}, function (context, circleAttribute, themeAttribute) {
|
|
33080
33457
|
if (picked) return !0;
|
|
33081
|
-
var lineWidth = circleAttribute.lineWidth || themeAttribute.lineWidth
|
|
33082
|
-
|
|
33458
|
+
var lineWidth = circleAttribute.lineWidth || themeAttribute.lineWidth,
|
|
33459
|
+
pickStrokeBuffer = circleAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
|
|
33460
|
+
return pickContext.lineWidth = lineWidth + pickStrokeBuffer, picked = context.isPointInStroke(point.x, point.y), picked;
|
|
33083
33461
|
}), pickContext.highPerformanceRestore(), picked;
|
|
33084
33462
|
}
|
|
33085
33463
|
}]);
|
|
@@ -33137,8 +33515,9 @@
|
|
|
33137
33515
|
return !!picked || (picked = context.isPointInPath(point.x, point.y), picked);
|
|
33138
33516
|
}, function (context, rectAttribute, themeAttribute) {
|
|
33139
33517
|
if (picked) return !0;
|
|
33140
|
-
var lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth
|
|
33141
|
-
|
|
33518
|
+
var lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth,
|
|
33519
|
+
pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
|
|
33520
|
+
return pickContext.lineWidth = lineWidth + pickStrokeBuffer, picked = context.isPointInStroke(point.x, point.y), picked;
|
|
33142
33521
|
});else if (picked) {
|
|
33143
33522
|
var _rect$attribute2 = rect.attribute,
|
|
33144
33523
|
_rect$attribute2$fill = _rect$attribute2.fill,
|
|
@@ -33203,8 +33582,9 @@
|
|
|
33203
33582
|
return !!picked || (picked = context.isPointInPath(point.x, point.y), picked);
|
|
33204
33583
|
}, function (context, arcAttribute, themeAttribute) {
|
|
33205
33584
|
if (picked) return !0;
|
|
33206
|
-
var lineWidth = arcAttribute.lineWidth || themeAttribute.lineWidth
|
|
33207
|
-
|
|
33585
|
+
var lineWidth = arcAttribute.lineWidth || themeAttribute.lineWidth,
|
|
33586
|
+
pickStrokeBuffer = arcAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
|
|
33587
|
+
return pickContext.lineWidth = lineWidth + pickStrokeBuffer, picked = context.isPointInStroke(point.x, point.y), picked;
|
|
33208
33588
|
}), pickContext.highPerformanceRestore(), picked;
|
|
33209
33589
|
}
|
|
33210
33590
|
}]);
|
|
@@ -33303,8 +33683,9 @@
|
|
|
33303
33683
|
return !!picked || (picked = context.isPointInPath(point.x, point.y), picked);
|
|
33304
33684
|
}, function (context, circleAttribute, themeAttribute) {
|
|
33305
33685
|
if (picked) return !0;
|
|
33306
|
-
var lineWidth = circleAttribute.lineWidth || themeAttribute.lineWidth
|
|
33307
|
-
|
|
33686
|
+
var lineWidth = circleAttribute.lineWidth || themeAttribute.lineWidth,
|
|
33687
|
+
pickStrokeBuffer = circleAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
|
|
33688
|
+
return pickContext.lineWidth = lineWidth + pickStrokeBuffer, picked = context.isPointInStroke(point.x, point.y), picked;
|
|
33308
33689
|
}), pickContext.highPerformanceRestore(), picked;
|
|
33309
33690
|
}
|
|
33310
33691
|
}]);
|
|
@@ -33355,8 +33736,9 @@
|
|
|
33355
33736
|
return !!picked || (picked = context.isPointInPath(point.x, point.y), picked);
|
|
33356
33737
|
}, function (context, symbolAttribute, themeAttribute) {
|
|
33357
33738
|
if (picked) return !0;
|
|
33358
|
-
var lineWidth = symbolAttribute.lineWidth || themeAttribute.lineWidth
|
|
33359
|
-
|
|
33739
|
+
var lineWidth = symbolAttribute.lineWidth || themeAttribute.lineWidth,
|
|
33740
|
+
pickStrokeBuffer = symbolAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
|
|
33741
|
+
return pickContext.lineWidth = lineWidth + pickStrokeBuffer, picked = context.isPointInStroke(point.x, point.y), picked;
|
|
33360
33742
|
}), pickContext.highPerformanceRestore(), picked;
|
|
33361
33743
|
}
|
|
33362
33744
|
}]);
|
|
@@ -33428,8 +33810,9 @@
|
|
|
33428
33810
|
return !!picked || (picked = context.isPointInPath(point.x, point.y), picked);
|
|
33429
33811
|
}, function (context, pathAttribute, themeAttribute) {
|
|
33430
33812
|
if (picked) return !0;
|
|
33431
|
-
var lineWidth = pathAttribute.lineWidth || themeAttribute.lineWidth
|
|
33432
|
-
|
|
33813
|
+
var lineWidth = pathAttribute.lineWidth || themeAttribute.lineWidth,
|
|
33814
|
+
pickStrokeBuffer = pathAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
|
|
33815
|
+
return pickContext.lineWidth = lineWidth + pickStrokeBuffer, picked = context.isPointInStroke(point.x, point.y), picked;
|
|
33433
33816
|
}), pickContext.highPerformanceRestore(), picked;
|
|
33434
33817
|
}
|
|
33435
33818
|
}]);
|
|
@@ -34730,7 +35113,7 @@
|
|
|
34730
35113
|
|
|
34731
35114
|
var roughModule = _roughModule;
|
|
34732
35115
|
|
|
34733
|
-
const version = "0.16.
|
|
35116
|
+
const version = "0.16.19-alpha.1";
|
|
34734
35117
|
loadAllModule(container);
|
|
34735
35118
|
|
|
34736
35119
|
exports.ACustomAnimate = ACustomAnimate;
|
|
@@ -34792,6 +35175,7 @@
|
|
|
34792
35175
|
exports.DefaultMatrixAllocate = DefaultMatrixAllocate;
|
|
34793
35176
|
exports.DefaultMorphingAnimateConfig = DefaultMorphingAnimateConfig;
|
|
34794
35177
|
exports.DefaultPathAttribute = DefaultPathAttribute;
|
|
35178
|
+
exports.DefaultPickStyle = DefaultPickStyle;
|
|
34795
35179
|
exports.DefaultPolygonAttribute = DefaultPolygonAttribute;
|
|
34796
35180
|
exports.DefaultRect3dAttribute = DefaultRect3dAttribute;
|
|
34797
35181
|
exports.DefaultRectAttribute = DefaultRectAttribute;
|