@antv/g-lite 2.0.0 → 2.0.2
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/Canvas.d.ts +2 -1
- package/dist/camera/Camera.d.ts +4 -0
- package/dist/index.esm.js +16 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +16 -7
- 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/RenderingService.d.ts +4 -3
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -1720,6 +1720,12 @@ var Camera = /** @class */ (function () {
|
|
|
1720
1720
|
this._update();
|
|
1721
1721
|
return this;
|
|
1722
1722
|
};
|
|
1723
|
+
/**
|
|
1724
|
+
* Set projection matrix manually.
|
|
1725
|
+
*/
|
|
1726
|
+
Camera.prototype.setProjectionMatrix = function (matrix) {
|
|
1727
|
+
this.projectionMatrix = matrix;
|
|
1728
|
+
};
|
|
1723
1729
|
Camera.prototype.setFov = function (fov) {
|
|
1724
1730
|
this.setPerspective(this.near, this.far, fov, this.aspect);
|
|
1725
1731
|
return this;
|
|
@@ -10099,7 +10105,7 @@ var RenderingService = /** @class */ (function () {
|
|
|
10099
10105
|
return (!enableDirtyRectangleRendering ||
|
|
10100
10106
|
this.context.renderingContext.renderReasons.has(exports.RenderReason.CAMERA_CHANGED));
|
|
10101
10107
|
};
|
|
10102
|
-
RenderingService.prototype.render = function (canvasConfig, rerenderCallback) {
|
|
10108
|
+
RenderingService.prototype.render = function (canvasConfig, frame, rerenderCallback) {
|
|
10103
10109
|
var _this = this;
|
|
10104
10110
|
this.stats.total = 0;
|
|
10105
10111
|
this.stats.rendered = 0;
|
|
@@ -10118,7 +10124,7 @@ var RenderingService = /** @class */ (function () {
|
|
|
10118
10124
|
if (shouldTriggerRenderHooks) {
|
|
10119
10125
|
this.renderDisplayObject(renderingContext.root, canvasConfig, renderingContext);
|
|
10120
10126
|
}
|
|
10121
|
-
this.hooks.beginFrame.call();
|
|
10127
|
+
this.hooks.beginFrame.call(frame);
|
|
10122
10128
|
if (shouldTriggerRenderHooks) {
|
|
10123
10129
|
renderingContext.renderListCurrentFrame.forEach(function (object) {
|
|
10124
10130
|
_this.hooks.beforeRender.call(object);
|
|
@@ -10126,7 +10132,7 @@ var RenderingService = /** @class */ (function () {
|
|
|
10126
10132
|
_this.hooks.afterRender.call(object);
|
|
10127
10133
|
});
|
|
10128
10134
|
}
|
|
10129
|
-
this.hooks.endFrame.call();
|
|
10135
|
+
this.hooks.endFrame.call(frame);
|
|
10130
10136
|
renderingContext.renderListCurrentFrame = [];
|
|
10131
10137
|
renderingContext.renderReasons.clear();
|
|
10132
10138
|
rerenderCallback();
|
|
@@ -13752,6 +13758,7 @@ var Text = /** @class */ (function (_super) {
|
|
|
13752
13758
|
*/
|
|
13753
13759
|
Text.prototype.getComputedTextLength = function () {
|
|
13754
13760
|
var _a;
|
|
13761
|
+
this.getGeometryBounds();
|
|
13755
13762
|
return ((_a = this.parsedStyle.metrics) === null || _a === void 0 ? void 0 : _a.maxLineWidth) || 0;
|
|
13756
13763
|
};
|
|
13757
13764
|
// getEndPositionOfChar(charnum: number): DOMPoint {
|
|
@@ -13777,9 +13784,11 @@ var Text = /** @class */ (function (_super) {
|
|
|
13777
13784
|
// }
|
|
13778
13785
|
Text.prototype.getLineBoundingRects = function () {
|
|
13779
13786
|
var _a;
|
|
13787
|
+
this.getGeometryBounds();
|
|
13780
13788
|
return ((_a = this.parsedStyle.metrics) === null || _a === void 0 ? void 0 : _a.lineMetrics) || [];
|
|
13781
13789
|
};
|
|
13782
13790
|
Text.prototype.isOverflowing = function () {
|
|
13791
|
+
this.getGeometryBounds();
|
|
13783
13792
|
return !!this.parsedStyle.isOverflowing;
|
|
13784
13793
|
};
|
|
13785
13794
|
return Text;
|
|
@@ -15193,11 +15202,11 @@ var Canvas = /** @class */ (function (_super) {
|
|
|
15193
15202
|
Canvas.prototype.destroyChildren = function () {
|
|
15194
15203
|
this.document.documentElement.destroyChildren();
|
|
15195
15204
|
};
|
|
15196
|
-
Canvas.prototype.render = function () {
|
|
15205
|
+
Canvas.prototype.render = function (frame) {
|
|
15197
15206
|
var _this = this;
|
|
15198
15207
|
this.dispatchEvent(beforeRenderEvent);
|
|
15199
15208
|
var renderingService = this.getRenderingService();
|
|
15200
|
-
renderingService.render(this.getConfig(), function () {
|
|
15209
|
+
renderingService.render(this.getConfig(), frame, function () {
|
|
15201
15210
|
// trigger actual rerender event
|
|
15202
15211
|
// @see https://github.com/antvis/G/issues/1268
|
|
15203
15212
|
_this.dispatchEvent(rerenderEvent);
|
|
@@ -15206,8 +15215,8 @@ var Canvas = /** @class */ (function (_super) {
|
|
|
15206
15215
|
};
|
|
15207
15216
|
Canvas.prototype.run = function () {
|
|
15208
15217
|
var _this = this;
|
|
15209
|
-
var tick = function () {
|
|
15210
|
-
_this.render();
|
|
15218
|
+
var tick = function (time, frame) {
|
|
15219
|
+
_this.render(frame);
|
|
15211
15220
|
_this.frameId = _this.requestAnimationFrame(tick);
|
|
15212
15221
|
};
|
|
15213
15222
|
tick();
|