@antv/g-lite 2.2.17 → 2.2.19
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/index.esm.js +12 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +12 -9
- package/dist/index.js.map +1 -1
- package/dist/index.umd.min.js +5 -5
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +2 -2
- package/types/services/TextService.d.ts.map +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @antv/g-lite
|
|
3
3
|
* @description A core module for rendering engine implements DOM API.
|
|
4
|
-
* @version 2.2.
|
|
5
|
-
* @date
|
|
4
|
+
* @version 2.2.19
|
|
5
|
+
* @date 5/9/2025, 8:18:56 AM
|
|
6
6
|
* @author AntVis
|
|
7
7
|
* @docs https://g.antv.antgroup.com/
|
|
8
8
|
*/
|
|
@@ -10553,8 +10553,8 @@ var RenderingService = /*#__PURE__*/function () {
|
|
|
10553
10553
|
}, {
|
|
10554
10554
|
key: "sort",
|
|
10555
10555
|
value: function sort(displayObject, sortable) {
|
|
10556
|
-
var _sortable$sorted;
|
|
10557
|
-
if (sortable.sorted && sortable.dirtyReason !== SortReason.Z_INDEX_CHANGED) {
|
|
10556
|
+
var _sortable$sorted, _sortable$sorted2;
|
|
10557
|
+
if ((sortable === null || sortable === void 0 || (_sortable$sorted = sortable.sorted) === null || _sortable$sorted === void 0 ? void 0 : _sortable$sorted.length) > 0 && sortable.dirtyReason !== SortReason.Z_INDEX_CHANGED) {
|
|
10558
10558
|
// avoid re-sorting the whole children list
|
|
10559
10559
|
sortable.dirtyChildren.forEach(function (child) {
|
|
10560
10560
|
// remove from sorted list
|
|
@@ -10577,7 +10577,7 @@ var RenderingService = /*#__PURE__*/function () {
|
|
|
10577
10577
|
}
|
|
10578
10578
|
|
|
10579
10579
|
// When the child elements are changed and sorted, if there are no more stacked elements in the child elements (i.e. zIndex != 0), clear the sort list
|
|
10580
|
-
if (((_sortable$
|
|
10580
|
+
if (((_sortable$sorted2 = sortable.sorted) === null || _sortable$sorted2 === void 0 ? void 0 : _sortable$sorted2.length) > 0 && displayObject.childNodes.filter(function (child) {
|
|
10581
10581
|
return child.parsedStyle.zIndex;
|
|
10582
10582
|
}).length === 0) {
|
|
10583
10583
|
sortable.sorted = [];
|
|
@@ -12046,7 +12046,8 @@ var TextService = /*#__PURE__*/function () {
|
|
|
12046
12046
|
var lines = [];
|
|
12047
12047
|
var currentLineIndex = 0;
|
|
12048
12048
|
var currentLineWidth = 0;
|
|
12049
|
-
|
|
12049
|
+
// @see https://github.com/antvis/G/issues/1932
|
|
12050
|
+
var prevLineLastCharIndex = -1;
|
|
12050
12051
|
var cache = {};
|
|
12051
12052
|
var calcWidth = function calcWidth(txt) {
|
|
12052
12053
|
return _this2.getFromCache(txt, letterSpacing, cache, context);
|
|
@@ -12070,7 +12071,9 @@ var TextService = /*#__PURE__*/function () {
|
|
|
12070
12071
|
txtLastCharIndex += 1;
|
|
12071
12072
|
lineTxt += chars[txtLastCharIndex];
|
|
12072
12073
|
}
|
|
12073
|
-
while (calcWidth(lineTxt) > widthThreshold &&
|
|
12074
|
+
while (calcWidth(lineTxt) > widthThreshold &&
|
|
12075
|
+
// @see https://github.com/antvis/G/issues/1932
|
|
12076
|
+
txtLastCharIndex >= txtStartCharIndex) {
|
|
12074
12077
|
txtLastCharIndex -= 1;
|
|
12075
12078
|
lineTxt = lineTxt.slice(0, -1);
|
|
12076
12079
|
}
|
|
@@ -16432,7 +16435,7 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
|
|
|
16432
16435
|
}, {
|
|
16433
16436
|
key: "mountChildren",
|
|
16434
16437
|
value: function mountChildren(child) {
|
|
16435
|
-
var
|
|
16438
|
+
var _this0 = this;
|
|
16436
16439
|
var skipTriggerEvent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isInFragment(child);
|
|
16437
16440
|
if (this.inited) {
|
|
16438
16441
|
if (!child.isConnected) {
|
|
@@ -16453,7 +16456,7 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
|
|
|
16453
16456
|
|
|
16454
16457
|
// recursively mount children
|
|
16455
16458
|
child.childNodes.forEach(function (c) {
|
|
16456
|
-
|
|
16459
|
+
_this0.mountChildren(c, skipTriggerEvent);
|
|
16457
16460
|
});
|
|
16458
16461
|
|
|
16459
16462
|
// trigger after mounted
|