@antv/g-lite 1.2.14 → 1.2.16
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 +29 -17
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +28 -16
- 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/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __assign, __read, __extends, __spreadArray, __awaiter, __generator, __values, __rest } from 'tslib';
|
|
2
2
|
import EventEmitter from 'eventemitter3';
|
|
3
3
|
import { mat4, vec4, vec3, mat3, quat as quat$1, vec2 } from 'gl-matrix';
|
|
4
|
-
import { isNumber, distanceSquareRoot, isString, isNil, clamp, getTotalLength, min, max, isNumberEqual, mod, normalizePath, path2Curve, equalizeSegments, getDrawDirection, reverseCurve, clonePath, getRotatedCurve, isBoolean, isObject, isUndefined, getPointAtLength } from '@antv/util';
|
|
4
|
+
import { isNumber, distanceSquareRoot, isString, isNil, clamp, getTotalLength, min, max, isNumberEqual, mod, normalizePath, path2Curve, equalizeSegments, getDrawDirection, reverseCurve, clonePath, getRotatedCurve, isArray, isBoolean, isObject, isUndefined, getPointAtLength } from '@antv/util';
|
|
5
5
|
import * as d3 from 'd3-color';
|
|
6
6
|
import { arcBox, cubicBox, quadBox, polylineLength, lineLength, linePointAt } from '@antv/g-math';
|
|
7
7
|
|
|
@@ -8167,17 +8167,23 @@ var PolylineUpdater = /** @class */ (function () {
|
|
|
8167
8167
|
function PolylineUpdater() {
|
|
8168
8168
|
}
|
|
8169
8169
|
PolylineUpdater.prototype.update = function (parsedStyle) {
|
|
8170
|
-
|
|
8171
|
-
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
|
|
8175
|
-
|
|
8176
|
-
|
|
8177
|
-
|
|
8170
|
+
if (parsedStyle.points && isArray(parsedStyle.points.points)) {
|
|
8171
|
+
var points = parsedStyle.points.points;
|
|
8172
|
+
// FIXME: account for miter lineJoin
|
|
8173
|
+
var minX = Math.min.apply(Math, __spreadArray([], __read(points.map(function (point) { return point[0]; })), false));
|
|
8174
|
+
var maxX = Math.max.apply(Math, __spreadArray([], __read(points.map(function (point) { return point[0]; })), false));
|
|
8175
|
+
var minY = Math.min.apply(Math, __spreadArray([], __read(points.map(function (point) { return point[1]; })), false));
|
|
8176
|
+
var maxY = Math.max.apply(Math, __spreadArray([], __read(points.map(function (point) { return point[1]; })), false));
|
|
8177
|
+
var width = maxX - minX;
|
|
8178
|
+
var height = maxY - minY;
|
|
8179
|
+
return {
|
|
8180
|
+
width: width,
|
|
8181
|
+
height: height,
|
|
8182
|
+
};
|
|
8183
|
+
}
|
|
8178
8184
|
return {
|
|
8179
|
-
width:
|
|
8180
|
-
height:
|
|
8185
|
+
width: 0,
|
|
8186
|
+
height: 0,
|
|
8181
8187
|
};
|
|
8182
8188
|
};
|
|
8183
8189
|
return PolylineUpdater;
|
|
@@ -10084,11 +10090,15 @@ var RenderingService = /** @class */ (function () {
|
|
|
10084
10090
|
// @ts-ignore
|
|
10085
10091
|
renderingContext.dirtyRectangleRenderingDisabled =
|
|
10086
10092
|
this.disableDirtyRectangleRendering();
|
|
10087
|
-
|
|
10093
|
+
var onlyCameraChanged = renderingContext.renderReasons.size === 1 &&
|
|
10094
|
+
renderingContext.renderReasons.has(RenderReason.CAMERA_CHANGED);
|
|
10095
|
+
var shouldTriggerRenderHooks = !canvasConfig.disableRenderHooks ||
|
|
10096
|
+
!(canvasConfig.disableRenderHooks && onlyCameraChanged);
|
|
10097
|
+
if (shouldTriggerRenderHooks) {
|
|
10088
10098
|
this.renderDisplayObject(renderingContext.root, canvasConfig, renderingContext);
|
|
10089
10099
|
}
|
|
10090
10100
|
this.hooks.beginFrame.call();
|
|
10091
|
-
if (
|
|
10101
|
+
if (shouldTriggerRenderHooks) {
|
|
10092
10102
|
renderingContext.renderListCurrentFrame.forEach(function (object) {
|
|
10093
10103
|
_this.hooks.beforeRender.call(object);
|
|
10094
10104
|
_this.hooks.render.call(object);
|
|
@@ -13625,9 +13635,10 @@ var Polygon = /** @class */ (function (_super) {
|
|
|
13625
13635
|
}
|
|
13626
13636
|
};
|
|
13627
13637
|
Polygon.prototype.transformMarker = function (isStart) {
|
|
13628
|
-
var _a = this.parsedStyle, markerStart = _a.markerStart, markerEnd = _a.markerEnd, markerStartOffset = _a.markerStartOffset, markerEndOffset = _a.markerEndOffset,
|
|
13638
|
+
var _a = this.parsedStyle, markerStart = _a.markerStart, markerEnd = _a.markerEnd, markerStartOffset = _a.markerStartOffset, markerEndOffset = _a.markerEndOffset, P = _a.points, defX = _a.defX, defY = _a.defY;
|
|
13639
|
+
var points = (P || {}).points;
|
|
13629
13640
|
var marker = isStart ? markerStart : markerEnd;
|
|
13630
|
-
if (!marker || !isDisplayObject(marker)) {
|
|
13641
|
+
if (!marker || !isDisplayObject(marker) || !points) {
|
|
13631
13642
|
return;
|
|
13632
13643
|
}
|
|
13633
13644
|
var rad = 0;
|
|
@@ -13666,13 +13677,14 @@ var Polygon = /** @class */ (function (_super) {
|
|
|
13666
13677
|
marker.setLocalPosition(ox + Math.cos(rad) * offset, oy + Math.sin(rad) * offset);
|
|
13667
13678
|
};
|
|
13668
13679
|
Polygon.prototype.placeMarkerMid = function (marker) {
|
|
13669
|
-
var _a = this.parsedStyle,
|
|
13680
|
+
var _a = this.parsedStyle, P = _a.points, defX = _a.defX, defY = _a.defY;
|
|
13681
|
+
var points = (P || {}).points;
|
|
13670
13682
|
// clear all existed markers
|
|
13671
13683
|
this.markerMidList.forEach(function (marker) {
|
|
13672
13684
|
marker.remove();
|
|
13673
13685
|
});
|
|
13674
13686
|
this.markerMidList = [];
|
|
13675
|
-
if (marker && isDisplayObject(marker)) {
|
|
13687
|
+
if (marker && isDisplayObject(marker) && points) {
|
|
13676
13688
|
for (var i = 1; i < (this.parsedStyle.isClosed ? points.length : points.length - 1); i++) {
|
|
13677
13689
|
var ox = points[i][0] - defX;
|
|
13678
13690
|
var oy = points[i][1] - defY;
|