@antv/g-lite 1.2.3 → 1.2.4

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.js CHANGED
@@ -13161,7 +13161,13 @@ var HTML = /** @class */ (function (_super) {
13161
13161
  * @see https://developer.mozilla.org/zh-CN/docs/Web/API/Element/getBoundingClientRect
13162
13162
  */
13163
13163
  HTML.prototype.getBoundingClientRect = function () {
13164
- return this.parsedStyle.$el.getBoundingClientRect();
13164
+ if (this.parsedStyle.$el) {
13165
+ return this.parsedStyle.$el.getBoundingClientRect();
13166
+ }
13167
+ else {
13168
+ var _a = this.parsedStyle, x = _a.x, y = _a.y, width = _a.width, height = _a.height;
13169
+ return new Rectangle(x, y, width, height);
13170
+ }
13165
13171
  };
13166
13172
  HTML.prototype.getClientRects = function () {
13167
13173
  return [this.getBoundingClientRect()];
@@ -13172,18 +13178,11 @@ var HTML = /** @class */ (function (_super) {
13172
13178
  // calc context's offset
13173
13179
  // @ts-ignore
13174
13180
  var canvasRect = (_b = (_a = this.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView) === null || _b === void 0 ? void 0 : _b.getContextService().getBoundingClientRect();
13175
- if (canvasRect) {
13176
- var minX = clientRect.left - canvasRect.left;
13177
- var minY = clientRect.top - canvasRect.top;
13178
- var aabb = new AABB();
13179
- // aabb.setMinMax(
13180
- // vec3.fromValues(minX, minY, 0),
13181
- // vec3.fromValues(minX + clientRect.width, minY + clientRect.height, 0),
13182
- // );
13183
- aabb.setMinMax([minX, minY, 0], [minX + clientRect.width, minY + clientRect.height, 0]);
13184
- return aabb;
13185
- }
13186
- return null;
13181
+ var aabb = new AABB();
13182
+ var minX = clientRect.left - ((canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.left) || 0);
13183
+ var minY = clientRect.top - ((canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.top) || 0);
13184
+ aabb.setMinMax([minX, minY, 0], [minX + clientRect.width, minY + clientRect.height, 0]);
13185
+ return aabb;
13187
13186
  };
13188
13187
  HTML.prototype.getLocalBounds = function () {
13189
13188
  if (this.parentNode) {