@antv/g-lite 2.0.8 → 2.0.9
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/display-objects/HTML.d.ts +4 -4
- package/dist/index.esm.js +44 -28
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +44 -27
- package/dist/index.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/services/aabb/HTMLUpdater.d.ts +10 -0
- package/dist/services/aabb/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8362,6 +8362,21 @@ var GroupUpdater = /** @class */ (function () {
|
|
|
8362
8362
|
return GroupUpdater;
|
|
8363
8363
|
}());
|
|
8364
8364
|
|
|
8365
|
+
var HTMLUpdater = /** @class */ (function () {
|
|
8366
|
+
function HTMLUpdater() {
|
|
8367
|
+
}
|
|
8368
|
+
HTMLUpdater.prototype.update = function (parsedStyle, object) {
|
|
8369
|
+
var _a = parsedStyle.x, x = _a === void 0 ? 0 : _a, _b = parsedStyle.y, y = _b === void 0 ? 0 : _b, _c = parsedStyle.width, width = _c === void 0 ? 0 : _c, _d = parsedStyle.height, height = _d === void 0 ? 0 : _d;
|
|
8370
|
+
return {
|
|
8371
|
+
cx: x + width / 2,
|
|
8372
|
+
cy: y + height / 2,
|
|
8373
|
+
hwidth: width / 2,
|
|
8374
|
+
hheight: height / 2,
|
|
8375
|
+
};
|
|
8376
|
+
};
|
|
8377
|
+
return HTMLUpdater;
|
|
8378
|
+
}());
|
|
8379
|
+
|
|
8365
8380
|
function isFederatedEvent(value) {
|
|
8366
8381
|
return !!value.type;
|
|
8367
8382
|
}
|
|
@@ -11676,7 +11691,7 @@ var geometryUpdaterFactory = (function () {
|
|
|
11676
11691
|
_a[exports.Shape.POLYLINE] = polylineUpdater,
|
|
11677
11692
|
_a[exports.Shape.POLYGON] = polylineUpdater,
|
|
11678
11693
|
_a[exports.Shape.PATH] = new PathUpdater(),
|
|
11679
|
-
_a[exports.Shape.HTML] =
|
|
11694
|
+
_a[exports.Shape.HTML] = new HTMLUpdater(),
|
|
11680
11695
|
_a[exports.Shape.MESH] = null,
|
|
11681
11696
|
_a;
|
|
11682
11697
|
})();
|
|
@@ -13189,35 +13204,36 @@ var HTML = /** @class */ (function (_super) {
|
|
|
13189
13204
|
/**
|
|
13190
13205
|
* override with $el.getBoundingClientRect
|
|
13191
13206
|
* @see https://developer.mozilla.org/zh-CN/docs/Web/API/Element/getBoundingClientRect
|
|
13192
|
-
|
|
13193
|
-
|
|
13194
|
-
|
|
13195
|
-
|
|
13196
|
-
|
|
13197
|
-
|
|
13198
|
-
|
|
13199
|
-
|
|
13200
|
-
|
|
13201
|
-
|
|
13202
|
-
|
|
13203
|
-
return new Rectangle(x, y, width, height);
|
|
13204
|
-
}
|
|
13205
|
-
};
|
|
13207
|
+
*
|
|
13208
|
+
* ! The calculation logic of the html element should be consistent with that of the canvas element
|
|
13209
|
+
*/
|
|
13210
|
+
// getBoundingClientRect(): Rectangle {
|
|
13211
|
+
// if (this.parsedStyle.$el) {
|
|
13212
|
+
// return this.parsedStyle.$el.getBoundingClientRect();
|
|
13213
|
+
// } else {
|
|
13214
|
+
// const { x, y, width, height } = this.parsedStyle;
|
|
13215
|
+
// return new Rectangle(x, y, width, height);
|
|
13216
|
+
// }
|
|
13217
|
+
// }
|
|
13206
13218
|
HTML.prototype.getClientRects = function () {
|
|
13207
13219
|
return [this.getBoundingClientRect()];
|
|
13208
13220
|
};
|
|
13209
|
-
|
|
13210
|
-
|
|
13211
|
-
|
|
13212
|
-
|
|
13213
|
-
|
|
13214
|
-
|
|
13215
|
-
|
|
13216
|
-
|
|
13217
|
-
|
|
13218
|
-
|
|
13219
|
-
|
|
13220
|
-
|
|
13221
|
+
// getBounds() {
|
|
13222
|
+
// const clientRect = this.getBoundingClientRect();
|
|
13223
|
+
// // calc context's offset
|
|
13224
|
+
// // @ts-ignore
|
|
13225
|
+
// const canvasRect = this.ownerDocument?.defaultView
|
|
13226
|
+
// ?.getContextService()
|
|
13227
|
+
// .getBoundingClientRect();
|
|
13228
|
+
// const aabb = new AABB();
|
|
13229
|
+
// const minX = clientRect.left - (canvasRect?.left || 0);
|
|
13230
|
+
// const minY = clientRect.top - (canvasRect?.top || 0);
|
|
13231
|
+
// aabb.setMinMax(
|
|
13232
|
+
// [minX, minY, 0],
|
|
13233
|
+
// [minX + clientRect.width, minY + clientRect.height, 0],
|
|
13234
|
+
// );
|
|
13235
|
+
// return aabb;
|
|
13236
|
+
// }
|
|
13221
13237
|
HTML.prototype.getLocalBounds = function () {
|
|
13222
13238
|
if (this.parentNode) {
|
|
13223
13239
|
var parentInvert = glMatrix.mat4.invert(glMatrix.mat4.create(), this.parentNode.getWorldTransform());
|
|
@@ -15499,6 +15515,7 @@ exports.Frustum = Frustum;
|
|
|
15499
15515
|
exports.Group = Group;
|
|
15500
15516
|
exports.GroupUpdater = GroupUpdater;
|
|
15501
15517
|
exports.HTML = HTML;
|
|
15518
|
+
exports.HTMLUpdater = HTMLUpdater;
|
|
15502
15519
|
exports.Image = Image;
|
|
15503
15520
|
exports.Line = Line;
|
|
15504
15521
|
exports.LineUpdater = LineUpdater;
|