@antv/g 5.0.23-alpha.9 → 5.1.0
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.umd.min.js +4 -3
- package/es/AbstractRenderer.d.ts +11 -0
- package/es/AbstractRenderer.js +17 -2
- package/es/Canvas.d.ts +1 -1
- package/es/Canvas.js +2 -0
- package/es/css/CSS.d.ts +2 -1
- package/es/css/CSS.js +6 -2
- package/es/css/CSSProperty.d.ts +3 -2
- package/es/css/StyleValueRegistry.d.ts +4 -2
- package/es/css/StyleValueRegistry.js +100 -95
- package/es/css/cssom/CSSNumericValue.js +1 -1
- package/es/css/index.d.ts +2 -1
- package/es/css/index.js +2 -1
- package/es/css/interfaces.d.ts +6 -0
- package/es/css/interfaces.js +2 -0
- package/es/css/layout/FragmentResult.d.ts +32 -0
- package/es/css/layout/FragmentResult.js +32 -0
- package/es/css/layout/LayoutChildren.d.ts +23 -0
- package/es/css/layout/LayoutChildren.js +55 -0
- package/es/css/layout/LayoutContext.d.ts +35 -0
- package/es/css/layout/LayoutContext.js +35 -0
- package/es/css/layout/LayoutDefinition.d.ts +20 -0
- package/es/css/layout/LayoutDefinition.js +9 -0
- package/es/css/layout/LayoutEdges.d.ts +24 -0
- package/es/css/layout/LayoutEdges.js +41 -0
- package/es/css/layout/LayoutEngine.d.ts +41 -0
- package/es/css/layout/LayoutEngine.js +332 -0
- package/es/css/layout/LayoutFragment.d.ts +26 -0
- package/es/css/layout/LayoutFragment.js +28 -0
- package/es/css/layout/LayoutObject.d.ts +46 -0
- package/es/css/layout/LayoutObject.js +172 -0
- package/es/css/layout/LayoutRegistry.d.ts +16 -0
- package/es/css/layout/LayoutRegistry.js +78 -0
- package/es/css/layout/LayoutWorkTask.d.ts +14 -0
- package/es/css/layout/LayoutWorkTask.js +1 -0
- package/es/css/layout/index.d.ts +11 -0
- package/es/css/layout/index.js +11 -0
- package/es/css/layout/types.d.ts +104 -0
- package/es/css/layout/types.js +66 -0
- package/es/css/parser/color.d.ts +1 -1
- package/es/css/parser/color.js +2 -2
- package/es/css/parser/dimension.js +5 -1
- package/es/css/parser/path.d.ts +2 -2
- package/es/css/parser/path.js +9 -2
- package/es/css/parser/points.d.ts +8 -1
- package/es/css/parser/points.js +33 -3
- package/es/css/parser/transform.js +1 -1
- package/es/css/properties/CSSPropertyClipPath.js +7 -1
- package/es/css/properties/CSSPropertyColor.d.ts +1 -1
- package/es/css/properties/CSSPropertyLengthOrPercentage.d.ts +1 -1
- package/es/css/properties/CSSPropertyLocalPosition.d.ts +0 -9
- package/es/css/properties/CSSPropertyLocalPosition.js +64 -20
- package/es/css/properties/CSSPropertyPath.d.ts +2 -2
- package/es/css/properties/CSSPropertyPath.js +7 -5
- package/es/css/properties/CSSPropertyPoints.js +3 -4
- package/es/css/properties/CSSPropertyTransform.d.ts +1 -1
- package/es/css/properties/CSSPropertyTransform.js +76 -104
- package/es/display-objects/Circle.d.ts +4 -0
- package/es/display-objects/Circle.js +2 -0
- package/es/display-objects/DisplayObject.d.ts +2 -9
- package/es/display-objects/DisplayObject.js +8 -27
- package/es/display-objects/Ellipse.d.ts +4 -0
- package/es/display-objects/Ellipse.js +2 -0
- package/es/display-objects/Group.d.ts +4 -0
- package/es/display-objects/Group.js +2 -0
- package/es/display-objects/HTML.d.ts +4 -4
- package/es/display-objects/HTML.js +5 -3
- package/es/display-objects/Image.d.ts +4 -0
- package/es/display-objects/Image.js +2 -0
- package/es/display-objects/Line.js +2 -0
- package/es/display-objects/Path.d.ts +2 -2
- package/es/display-objects/Polygon.js +1 -1
- package/es/display-objects/Polyline.js +1 -1
- package/es/display-objects/Rect.d.ts +6 -2
- package/es/display-objects/Rect.js +2 -0
- package/es/display-objects/Text.d.ts +4 -0
- package/es/display-objects/Text.js +2 -0
- package/es/dom/Document.js +2 -2
- package/es/dom/Element.js +1 -0
- package/es/global-module.js +91 -8
- package/es/index.d.ts +3 -0
- package/es/index.js +3 -0
- package/es/plugins/CullingPlugin.d.ts +1 -0
- package/es/plugins/CullingPlugin.js +8 -3
- package/es/plugins/DirtyCheckPlugin.d.ts +1 -0
- package/es/plugins/DirtyCheckPlugin.js +7 -2
- package/es/plugins/EventPlugin.d.ts +1 -0
- package/es/plugins/EventPlugin.js +14 -9
- package/es/plugins/PrepareRendererPlugin.d.ts +1 -0
- package/es/plugins/PrepareRendererPlugin.js +10 -5
- package/es/services/EventService.js +14 -10
- package/es/services/OffscreenCanvasCreator.d.ts +1 -1
- package/es/services/OffscreenCanvasCreator.js +1 -1
- package/es/services/RenderingService.d.ts +18 -18
- package/es/services/RenderingService.js +26 -23
- package/es/services/SceneGraphService.d.ts +2 -0
- package/es/services/SceneGraphService.js +12 -1
- package/es/services/aabb/CircleUpdater.d.ts +0 -2
- package/es/services/aabb/CircleUpdater.js +2 -6
- package/es/services/aabb/EllipseUpdater.d.ts +0 -2
- package/es/services/aabb/EllipseUpdater.js +2 -6
- package/es/services/aabb/LineUpdater.d.ts +0 -2
- package/es/services/aabb/LineUpdater.js +1 -3
- package/es/services/aabb/PathUpdater.d.ts +0 -2
- package/es/services/aabb/PathUpdater.js +1 -5
- package/es/services/aabb/PolylineUpdater.d.ts +0 -2
- package/es/services/aabb/PolylineUpdater.js +1 -3
- package/es/services/aabb/RectUpdater.d.ts +0 -2
- package/es/services/aabb/RectUpdater.js +1 -5
- package/es/services/aabb/TextUpdater.d.ts +7 -0
- package/es/services/aabb/TextUpdater.js +0 -4
- package/es/services/aabb/interfaces.d.ts +0 -3
- package/es/types.d.ts +12 -23
- package/es/types.js +1 -0
- package/es/utils/deferred.d.ts +43 -0
- package/es/utils/deferred.js +117 -0
- package/es/utils/dom.d.ts +2 -0
- package/es/utils/dom.js +8 -0
- package/es/utils/index.d.ts +2 -1
- package/es/utils/index.js +2 -1
- package/es/utils/interpolation.js +3 -9
- package/es/utils/math.js +4 -3
- package/es/utils/path.d.ts +2 -2
- package/es/utils/path.js +61 -24
- package/lib/AbstractRenderer.d.ts +11 -0
- package/lib/AbstractRenderer.js +17 -2
- package/lib/Canvas.d.ts +1 -1
- package/lib/Canvas.js +2 -0
- package/lib/css/CSS.d.ts +2 -1
- package/lib/css/CSS.js +9 -3
- package/lib/css/CSSProperty.d.ts +3 -2
- package/lib/css/StyleValueRegistry.d.ts +4 -2
- package/lib/css/StyleValueRegistry.js +104 -96
- package/lib/css/cssom/CSSNumericValue.js +17 -17
- package/lib/css/index.d.ts +2 -1
- package/lib/css/index.js +25 -12
- package/lib/css/interfaces.d.ts +6 -0
- package/lib/css/interfaces.js +12 -0
- package/lib/css/layout/FragmentResult.d.ts +32 -0
- package/lib/css/layout/FragmentResult.js +51 -0
- package/lib/css/layout/LayoutChildren.d.ts +23 -0
- package/lib/css/layout/LayoutChildren.js +72 -0
- package/lib/css/layout/LayoutContext.d.ts +35 -0
- package/lib/css/layout/LayoutContext.js +49 -0
- package/lib/css/layout/LayoutDefinition.d.ts +20 -0
- package/lib/css/layout/LayoutDefinition.js +16 -0
- package/lib/css/layout/LayoutEdges.d.ts +24 -0
- package/lib/css/layout/LayoutEdges.js +56 -0
- package/lib/css/layout/LayoutEngine.d.ts +41 -0
- package/lib/css/layout/LayoutEngine.js +345 -0
- package/lib/css/layout/LayoutFragment.d.ts +26 -0
- package/lib/css/layout/LayoutFragment.js +44 -0
- package/lib/css/layout/LayoutObject.d.ts +46 -0
- package/lib/css/layout/LayoutObject.js +182 -0
- package/lib/css/layout/LayoutRegistry.d.ts +16 -0
- package/lib/css/layout/LayoutRegistry.js +87 -0
- package/lib/css/layout/LayoutWorkTask.d.ts +14 -0
- package/lib/css/layout/LayoutWorkTask.js +5 -0
- package/lib/css/layout/index.d.ts +11 -0
- package/lib/css/layout/index.js +148 -0
- package/lib/css/layout/types.d.ts +104 -0
- package/lib/css/layout/types.js +74 -0
- package/lib/css/parser/color.d.ts +1 -1
- package/lib/css/parser/color.js +1 -1
- package/lib/css/parser/dimension.js +4 -0
- package/lib/css/parser/path.d.ts +2 -2
- package/lib/css/parser/path.js +9 -2
- package/lib/css/parser/points.d.ts +8 -1
- package/lib/css/parser/points.js +33 -3
- package/lib/css/parser/transform.js +1 -1
- package/lib/css/properties/CSSPropertyClipPath.js +8 -1
- package/lib/css/properties/CSSPropertyColor.d.ts +1 -1
- package/lib/css/properties/CSSPropertyLengthOrPercentage.d.ts +1 -1
- package/lib/css/properties/CSSPropertyLocalPosition.d.ts +0 -9
- package/lib/css/properties/CSSPropertyLocalPosition.js +65 -20
- package/lib/css/properties/CSSPropertyPath.d.ts +2 -2
- package/lib/css/properties/CSSPropertyPath.js +7 -5
- package/lib/css/properties/CSSPropertyPoints.js +3 -4
- package/lib/css/properties/CSSPropertyTransform.d.ts +1 -1
- package/lib/css/properties/CSSPropertyTransform.js +75 -103
- package/lib/display-objects/Circle.d.ts +4 -0
- package/lib/display-objects/Circle.js +2 -0
- package/lib/display-objects/DisplayObject.d.ts +2 -9
- package/lib/display-objects/DisplayObject.js +9 -29
- package/lib/display-objects/Ellipse.d.ts +4 -0
- package/lib/display-objects/Ellipse.js +2 -0
- package/lib/display-objects/Group.d.ts +4 -0
- package/lib/display-objects/Group.js +2 -0
- package/lib/display-objects/HTML.d.ts +4 -4
- package/lib/display-objects/HTML.js +5 -3
- package/lib/display-objects/Image.d.ts +4 -0
- package/lib/display-objects/Image.js +2 -0
- package/lib/display-objects/Line.js +2 -0
- package/lib/display-objects/Path.d.ts +2 -2
- package/lib/display-objects/Polygon.js +1 -1
- package/lib/display-objects/Polyline.js +1 -1
- package/lib/display-objects/Rect.d.ts +6 -2
- package/lib/display-objects/Rect.js +2 -0
- package/lib/display-objects/Text.d.ts +4 -0
- package/lib/display-objects/Text.js +2 -0
- package/lib/dom/Document.js +2 -2
- package/lib/dom/Element.js +1 -0
- package/lib/global-module.js +91 -6
- package/lib/index.d.ts +3 -0
- package/lib/index.js +7 -2
- package/lib/plugins/CullingPlugin.d.ts +1 -0
- package/lib/plugins/CullingPlugin.js +7 -3
- package/lib/plugins/DirtyCheckPlugin.d.ts +1 -0
- package/lib/plugins/DirtyCheckPlugin.js +6 -2
- package/lib/plugins/EventPlugin.d.ts +1 -0
- package/lib/plugins/EventPlugin.js +13 -9
- package/lib/plugins/PrepareRendererPlugin.d.ts +1 -0
- package/lib/plugins/PrepareRendererPlugin.js +9 -5
- package/lib/services/EventService.js +14 -10
- package/lib/services/OffscreenCanvasCreator.d.ts +1 -1
- package/lib/services/OffscreenCanvasCreator.js +1 -1
- package/lib/services/RenderingService.d.ts +18 -18
- package/lib/services/RenderingService.js +26 -23
- package/lib/services/SceneGraphService.d.ts +2 -0
- package/lib/services/SceneGraphService.js +15 -1
- package/lib/services/aabb/CircleUpdater.d.ts +0 -2
- package/lib/services/aabb/CircleUpdater.js +2 -6
- package/lib/services/aabb/EllipseUpdater.d.ts +0 -2
- package/lib/services/aabb/EllipseUpdater.js +2 -6
- package/lib/services/aabb/LineUpdater.d.ts +0 -2
- package/lib/services/aabb/LineUpdater.js +1 -3
- package/lib/services/aabb/PathUpdater.d.ts +0 -2
- package/lib/services/aabb/PathUpdater.js +1 -5
- package/lib/services/aabb/PolylineUpdater.d.ts +0 -2
- package/lib/services/aabb/PolylineUpdater.js +1 -3
- package/lib/services/aabb/RectUpdater.d.ts +0 -2
- package/lib/services/aabb/RectUpdater.js +1 -5
- package/lib/services/aabb/TextUpdater.d.ts +7 -0
- package/lib/services/aabb/TextUpdater.js +0 -4
- package/lib/services/aabb/interfaces.d.ts +0 -3
- package/lib/types.d.ts +12 -23
- package/lib/types.js +1 -0
- package/lib/utils/deferred.d.ts +43 -0
- package/lib/utils/deferred.js +131 -0
- package/lib/utils/dom.d.ts +2 -0
- package/lib/utils/dom.js +17 -0
- package/lib/utils/index.d.ts +2 -1
- package/lib/utils/index.js +17 -4
- package/lib/utils/interpolation.js +4 -10
- package/lib/utils/math.js +4 -3
- package/lib/utils/path.d.ts +2 -2
- package/lib/utils/path.js +55 -24
- package/package.json +4 -3
- package/es/css/LayoutRegistry.d.ts +0 -11
- package/es/css/LayoutRegistry.js +0 -22
- package/es/utils/hooks.d.ts +0 -280
- package/es/utils/hooks.js +0 -753
- package/lib/css/LayoutRegistry.d.ts +0 -11
- package/lib/css/LayoutRegistry.js +0 -30
- package/lib/utils/hooks.d.ts +0 -280
- package/lib/utils/hooks.js +0 -759
package/es/css/parser/points.js
CHANGED
|
@@ -1,8 +1,26 @@
|
|
|
1
|
+
import { __read, __spreadArray } from "tslib";
|
|
1
2
|
import { Line as LineUtil, Polyline as PolylineUtil } from '@antv/g-math';
|
|
2
3
|
import { isString } from '../../utils';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* @see https://developer.mozilla.org/zh-CN/docs/Web/SVG/Attribute/points
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* points="100,10 250,150 200,110"
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export function parsePoints(pointsOrStr, object) {
|
|
12
|
+
var points;
|
|
13
|
+
|
|
14
|
+
if (isString(pointsOrStr)) {
|
|
15
|
+
points = pointsOrStr.split(' ').map(function (pointStr) {
|
|
16
|
+
var _a = __read(pointStr.split(','), 2),
|
|
17
|
+
x = _a[0],
|
|
18
|
+
y = _a[1];
|
|
19
|
+
|
|
20
|
+
return [Number(x), Number(y)];
|
|
21
|
+
});
|
|
22
|
+
} else {
|
|
23
|
+
points = pointsOrStr;
|
|
6
24
|
}
|
|
7
25
|
|
|
8
26
|
var segments = [];
|
|
@@ -20,6 +38,18 @@ export function parsePoints(points) {
|
|
|
20
38
|
segments.push(segmentT);
|
|
21
39
|
}
|
|
22
40
|
});
|
|
41
|
+
var minX = Math.min.apply(Math, __spreadArray([], __read(points.map(function (point) {
|
|
42
|
+
return point[0];
|
|
43
|
+
})), false));
|
|
44
|
+
var minY = Math.min.apply(Math, __spreadArray([], __read(points.map(function (point) {
|
|
45
|
+
return point[1];
|
|
46
|
+
})), false));
|
|
47
|
+
|
|
48
|
+
if (object) {
|
|
49
|
+
object.parsedStyle.defX = minX;
|
|
50
|
+
object.parsedStyle.defY = minY;
|
|
51
|
+
}
|
|
52
|
+
|
|
23
53
|
return {
|
|
24
54
|
points: points,
|
|
25
55
|
totalLength: totalLength,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { singleton } from 'mana-syringe';
|
|
3
3
|
import { dirtifyToRoot } from '../../services';
|
|
4
|
+
import { CSSKeywordValue } from '../cssom';
|
|
4
5
|
/**
|
|
5
6
|
* @see /zh/docs/api/basic/display-object#clippath
|
|
6
7
|
* @example
|
|
@@ -25,7 +26,12 @@ function () {
|
|
|
25
26
|
function CSSPropertyClipPath() {}
|
|
26
27
|
|
|
27
28
|
CSSPropertyClipPath.prototype.calculator = function (name, oldClipPath, newClipPath, object) {
|
|
28
|
-
//
|
|
29
|
+
// unset
|
|
30
|
+
if (newClipPath instanceof CSSKeywordValue) {
|
|
31
|
+
newClipPath = null;
|
|
32
|
+
} // clear ref to old clip path
|
|
33
|
+
|
|
34
|
+
|
|
29
35
|
if (oldClipPath && oldClipPath !== newClipPath && oldClipPath.style.clipPathTargets) {
|
|
30
36
|
var index = oldClipPath.style.clipPathTargets.indexOf(object);
|
|
31
37
|
oldClipPath.style.clipPathTargets.splice(index, 1);
|
|
@@ -3,7 +3,7 @@ import type { DisplayObject } from '../../display-objects';
|
|
|
3
3
|
import { parseColor, mergeColors } from '../parser';
|
|
4
4
|
import type { CSSGradientValue } from '../cssom';
|
|
5
5
|
import { CSSKeywordValue, CSSRGB } from '../cssom';
|
|
6
|
-
import type { StyleValueRegistry } from '../
|
|
6
|
+
import type { StyleValueRegistry } from '../interfaces';
|
|
7
7
|
/**
|
|
8
8
|
* opacity
|
|
9
9
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSUnitValue } from '../cssom';
|
|
2
2
|
import { mergeDimensions } from '../parser';
|
|
3
|
-
import type { StyleValueRegistry } from '../
|
|
3
|
+
import type { StyleValueRegistry } from '../interfaces';
|
|
4
4
|
import type { DisplayObject } from '../../display-objects';
|
|
5
5
|
import type { CSSProperty } from '../CSSProperty';
|
|
6
6
|
/**
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
import type { DisplayObject } from '../../display-objects';
|
|
2
2
|
import type { CSSProperty } from '../CSSProperty';
|
|
3
3
|
import type { CSSUnitValue } from '../cssom';
|
|
4
|
-
import { mergeDimensions } from '../parser';
|
|
5
4
|
import { CSSPropertyLengthOrPercentage } from './CSSPropertyLengthOrPercentage';
|
|
6
5
|
/**
|
|
7
6
|
* local position
|
|
8
7
|
*/
|
|
9
8
|
export declare class CSSPropertyLocalPosition extends CSSPropertyLengthOrPercentage implements Partial<CSSProperty<CSSUnitValue, CSSUnitValue>> {
|
|
10
|
-
/**
|
|
11
|
-
* <length> & <percentage>
|
|
12
|
-
*/
|
|
13
|
-
parser: (css: string) => CSSUnitValue;
|
|
14
|
-
/**
|
|
15
|
-
* mix between CSS.px(x)
|
|
16
|
-
*/
|
|
17
|
-
mixer: typeof mergeDimensions;
|
|
18
9
|
/**
|
|
19
10
|
* update local position
|
|
20
11
|
*/
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { __decorate, __extends } from "tslib";
|
|
1
|
+
import { __decorate, __extends, __read } from "tslib";
|
|
2
2
|
import { singleton } from 'mana-syringe';
|
|
3
|
-
import { mergeDimensions, parseLengthOrPercentage } from '../parser';
|
|
4
3
|
import { CSSPropertyLengthOrPercentage } from './CSSPropertyLengthOrPercentage';
|
|
4
|
+
import { isNil } from '../../utils';
|
|
5
|
+
import { Shape } from '../../types';
|
|
5
6
|
/**
|
|
6
7
|
* local position
|
|
7
8
|
*/
|
|
@@ -12,19 +13,7 @@ function (_super) {
|
|
|
12
13
|
__extends(CSSPropertyLocalPosition, _super);
|
|
13
14
|
|
|
14
15
|
function CSSPropertyLocalPosition() {
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* <length> & <percentage>
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_this.parser = parseLengthOrPercentage;
|
|
22
|
-
/**
|
|
23
|
-
* mix between CSS.px(x)
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
_this.mixer = mergeDimensions;
|
|
27
|
-
return _this;
|
|
16
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
28
17
|
}
|
|
29
18
|
/**
|
|
30
19
|
* update local position
|
|
@@ -32,11 +21,66 @@ function (_super) {
|
|
|
32
21
|
|
|
33
22
|
|
|
34
23
|
CSSPropertyLocalPosition.prototype.postProcessor = function (object) {
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
object.
|
|
24
|
+
var x;
|
|
25
|
+
var y;
|
|
26
|
+
var z;
|
|
27
|
+
|
|
28
|
+
switch (object.nodeName) {
|
|
29
|
+
case Shape.CIRCLE:
|
|
30
|
+
case Shape.ELLIPSE:
|
|
31
|
+
var _a = object.parsedStyle,
|
|
32
|
+
cx = _a.cx,
|
|
33
|
+
cy = _a.cy;
|
|
34
|
+
|
|
35
|
+
if (!isNil(cx)) {
|
|
36
|
+
x = cx.value;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (!isNil(cy)) {
|
|
40
|
+
y = cy.value;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
break;
|
|
44
|
+
|
|
45
|
+
case Shape.RECT:
|
|
46
|
+
case Shape.GROUP:
|
|
47
|
+
case Shape.IMAGE:
|
|
48
|
+
case Shape.HTML:
|
|
49
|
+
case Shape.TEXT:
|
|
50
|
+
case Shape.MESH:
|
|
51
|
+
if (!isNil(object.parsedStyle.x)) {
|
|
52
|
+
x = object.parsedStyle.x.value;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (!isNil(object.parsedStyle.y)) {
|
|
56
|
+
y = object.parsedStyle.y.value;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
break;
|
|
60
|
+
|
|
61
|
+
case Shape.LINE:
|
|
62
|
+
var _b = object.parsedStyle,
|
|
63
|
+
x1 = _b.x1,
|
|
64
|
+
x2 = _b.x2,
|
|
65
|
+
y1 = _b.y1,
|
|
66
|
+
y2 = _b.y2;
|
|
67
|
+
var minX = Math.min(x1.value, x2.value);
|
|
68
|
+
var minY = Math.min(y1.value, y2.value);
|
|
69
|
+
x = minX;
|
|
70
|
+
y = minY;
|
|
71
|
+
z = 0;
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
object.parsedStyle.defX = x || 0;
|
|
76
|
+
object.parsedStyle.defY = y || 0;
|
|
77
|
+
|
|
78
|
+
var _c = __read(object.getLocalPosition(), 3),
|
|
79
|
+
ox = _c[0],
|
|
80
|
+
oy = _c[1],
|
|
81
|
+
oz = _c[2];
|
|
82
|
+
|
|
83
|
+
object.setLocalPosition(isNil(x) ? ox : x, isNil(y) ? oy : y, isNil(z) ? oz : z);
|
|
40
84
|
};
|
|
41
85
|
|
|
42
86
|
CSSPropertyLocalPosition = __decorate([singleton()], CSSPropertyLocalPosition);
|
|
@@ -8,12 +8,12 @@ export declare class CSSPropertyPath implements Partial<CSSProperty<ParsedPathSt
|
|
|
8
8
|
*/
|
|
9
9
|
parser: typeof parsePath;
|
|
10
10
|
calculator(name: string, oldParsed: ParsedPathStyleProps['path'], parsed: ParsedPathStyleProps['path']): {
|
|
11
|
-
absolutePath: import("
|
|
11
|
+
absolutePath: import("../..").PathCommand[];
|
|
12
12
|
hasArc: boolean;
|
|
13
13
|
segments: import("../../display-objects").PathSegment[];
|
|
14
14
|
polygons: [number, number][][];
|
|
15
15
|
polylines: [number, number][][];
|
|
16
|
-
curve: import("
|
|
16
|
+
curve: import("../..").PathCommand[];
|
|
17
17
|
totalLength: number;
|
|
18
18
|
curveSegments: number[][];
|
|
19
19
|
zCommandIndexes: number[];
|
|
@@ -16,7 +16,8 @@ function () {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
CSSPropertyPath.prototype.calculator = function (name, oldParsed, parsed) {
|
|
19
|
-
|
|
19
|
+
// unset
|
|
20
|
+
if (parsed instanceof CSSKeywordValue && parsed.value === 'unset') {
|
|
20
21
|
return {
|
|
21
22
|
absolutePath: [],
|
|
22
23
|
hasArc: false,
|
|
@@ -40,10 +41,11 @@ function () {
|
|
|
40
41
|
|
|
41
42
|
CSSPropertyPath.prototype.postProcessor = function (object) {
|
|
42
43
|
var _a = object.parsedStyle,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
_b = _a.defX,
|
|
45
|
+
defX = _b === void 0 ? 0 : _b,
|
|
46
|
+
_c = _a.defY,
|
|
47
|
+
defY = _c === void 0 ? 0 : _c;
|
|
48
|
+
object.setLocalPosition(defX, defY);
|
|
47
49
|
};
|
|
48
50
|
|
|
49
51
|
CSSPropertyPath = __decorate([singleton()], CSSPropertyPath);
|
|
@@ -15,10 +15,9 @@ function () {
|
|
|
15
15
|
|
|
16
16
|
CSSPropertyPoints.prototype.postProcessor = function (object) {
|
|
17
17
|
var _a = object.parsedStyle,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
object.setLocalPosition(x && x.value || 0, y && y.value || 0, z && z.value || 0);
|
|
18
|
+
defX = _a.defX,
|
|
19
|
+
defY = _a.defY;
|
|
20
|
+
object.setLocalPosition(defX, defY);
|
|
22
21
|
};
|
|
23
22
|
|
|
24
23
|
CSSPropertyPoints = __decorate([singleton()], CSSPropertyPoints);
|
|
@@ -34,5 +34,5 @@ import { parseTransform, mergeTransforms } from '../parser';
|
|
|
34
34
|
export declare class CSSPropertyTransform implements Partial<CSSProperty<any[], any[]>> {
|
|
35
35
|
parser: typeof parseTransform;
|
|
36
36
|
mixer: typeof mergeTransforms;
|
|
37
|
-
|
|
37
|
+
postProcessor(object: DisplayObject): void;
|
|
38
38
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { singleton } from 'mana-syringe';
|
|
3
|
-
import {
|
|
3
|
+
import { Opx, Odeg } from '../cssom';
|
|
4
4
|
import { parseTransform, mergeTransforms } from '../parser';
|
|
5
5
|
/**
|
|
6
6
|
* @see /zh/docs/api/animation#支持变换的属性
|
|
@@ -41,112 +41,84 @@ function () {
|
|
|
41
41
|
this.mixer = mergeTransforms;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
CSSPropertyTransform.prototype.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
// ...(newValue || []).map(({ t }) => t),
|
|
50
|
-
// ]);
|
|
44
|
+
CSSPropertyTransform.prototype.postProcessor = function (object) {
|
|
45
|
+
var _a = object.parsedStyle,
|
|
46
|
+
transform = _a.transform,
|
|
47
|
+
defX = _a.defX,
|
|
48
|
+
defY = _a.defY;
|
|
51
49
|
|
|
50
|
+
if (transform && transform.length) {
|
|
51
|
+
// reset transform
|
|
52
|
+
object.resetLocalTransform();
|
|
53
|
+
object.setLocalPosition(defX, defY);
|
|
54
|
+
transform.forEach(function (_a) {
|
|
55
|
+
var t = _a.t,
|
|
56
|
+
d = _a.d;
|
|
52
57
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
if (t === 'scale') {
|
|
59
|
+
// scale(1) scale(1, 1)
|
|
60
|
+
var newScale = d.map(function (s) {
|
|
61
|
+
return s.value;
|
|
62
|
+
}) || [1, 1];
|
|
63
|
+
object.scaleLocal(newScale[0], newScale[1], 1);
|
|
64
|
+
} else if (t === 'scalex') {
|
|
65
|
+
var newScale = d.map(function (s) {
|
|
66
|
+
return s.value;
|
|
67
|
+
}) || [1];
|
|
68
|
+
object.scaleLocal(newScale[0], 1, 1);
|
|
69
|
+
} else if (t === 'scaley') {
|
|
70
|
+
var newScale = d.map(function (s) {
|
|
71
|
+
return s.value;
|
|
72
|
+
}) || [1];
|
|
73
|
+
object.scaleLocal(1, newScale[0], 1);
|
|
74
|
+
} else if (t === 'scalez') {
|
|
75
|
+
var newScale = d.map(function (s) {
|
|
76
|
+
return s.value;
|
|
77
|
+
}) || [1];
|
|
78
|
+
object.scaleLocal(1, 1, newScale[0]);
|
|
79
|
+
} else if (t === 'scale3d') {
|
|
80
|
+
var newScale = d.map(function (s) {
|
|
81
|
+
return s.value;
|
|
82
|
+
}) || [1, 1, 1];
|
|
83
|
+
object.scaleLocal(newScale[0], newScale[1], newScale[2]);
|
|
84
|
+
} else if (t === 'translate') {
|
|
85
|
+
var newTranslation = d || [Opx, Opx];
|
|
86
|
+
object.translateLocal(newTranslation[0].value, newTranslation[1].value, 0);
|
|
87
|
+
} else if (t === 'translatex') {
|
|
88
|
+
var newTranslation = d || [Opx];
|
|
89
|
+
object.translateLocal(newTranslation[0].value, 0, 0);
|
|
90
|
+
} else if (t === 'translatey') {
|
|
91
|
+
var newTranslation = d || [Opx];
|
|
92
|
+
object.translateLocal(0, newTranslation[0].value, 0);
|
|
93
|
+
} else if (t === 'translatez') {
|
|
94
|
+
var newTranslation = d || [Opx];
|
|
95
|
+
object.translateLocal(0, 0, newTranslation[0].value);
|
|
96
|
+
} else if (t === 'translate3d') {
|
|
97
|
+
var newTranslation = d || [Opx, Opx, Opx];
|
|
98
|
+
object.translateLocal(newTranslation[0].value, newTranslation[1].value, newTranslation[2].value);
|
|
99
|
+
} else if (t === 'rotate') {
|
|
100
|
+
var newAngles = d || [Odeg];
|
|
101
|
+
object.rotateLocal(0, 0, newAngles[0].value);
|
|
102
|
+
} else if (t === 'rotatex') {
|
|
103
|
+
var newAngles = d || [Odeg];
|
|
104
|
+
object.rotateLocal(newAngles[0].value, 0, 0);
|
|
105
|
+
} else if (t === 'rotatey') {
|
|
106
|
+
var newAngles = d || [Odeg];
|
|
107
|
+
object.rotateLocal(0, newAngles[0].value, 0);
|
|
108
|
+
} else if (t === 'rotatez') {
|
|
109
|
+
var newAngles = d || [Odeg];
|
|
110
|
+
object.rotateLocal(0, 0, newAngles[0].value);
|
|
111
|
+
} else if (t === 'rotate3d') {// 暂不支持绕指定轴旋转
|
|
112
|
+
// const newAngles = value && value.d || [Odeg, Odeg, Odeg];
|
|
113
|
+
// const oldAngles = old && old.d || [Odeg, Odeg, Odeg];
|
|
114
|
+
// object.rotateLocal(
|
|
115
|
+
// newAngles[0].value - oldAngles[0].value,
|
|
116
|
+
// newAngles[1].value - oldAngles[1].value,
|
|
117
|
+
// newAngles[2].value - oldAngles[2].value,
|
|
118
|
+
// );
|
|
119
|
+
}
|
|
57
120
|
});
|
|
58
|
-
|
|
59
|
-
return o.t === t;
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
if (t === 'scale') {
|
|
63
|
-
// scale(1) scale(1, 1)
|
|
64
|
-
var newScale = value && value.d && value.d.map(function (s) {
|
|
65
|
-
return s.value;
|
|
66
|
-
}) || [1, 1];
|
|
67
|
-
var oldScale = old && old.d && old.d.map(function (s) {
|
|
68
|
-
return s.value;
|
|
69
|
-
}) || [1, 1];
|
|
70
|
-
object.scaleLocal(newScale[0] / oldScale[0], newScale[1] / oldScale[1], 1);
|
|
71
|
-
} else if (t === 'scalex') {
|
|
72
|
-
var newScale = value && value.d && value.d.map(function (s) {
|
|
73
|
-
return s.value;
|
|
74
|
-
}) || [1];
|
|
75
|
-
var oldScale = old && old.d && old.d.map(function (s) {
|
|
76
|
-
return s.value;
|
|
77
|
-
}) || [1];
|
|
78
|
-
object.scaleLocal(newScale[0] / oldScale[0], 1, 1);
|
|
79
|
-
} else if (t === 'scaley') {
|
|
80
|
-
var newScale = value && value.d && value.d.map(function (s) {
|
|
81
|
-
return s.value;
|
|
82
|
-
}) || [1];
|
|
83
|
-
var oldScale = old && old.d && old.d.map(function (s) {
|
|
84
|
-
return s.value;
|
|
85
|
-
}) || [1];
|
|
86
|
-
object.scaleLocal(1, newScale[0] / oldScale[0], 1);
|
|
87
|
-
} else if (t === 'scalez') {
|
|
88
|
-
var newScale = value && value.d && value.d.map(function (s) {
|
|
89
|
-
return s.value;
|
|
90
|
-
}) || [1];
|
|
91
|
-
var oldScale = old && old.d && old.d.map(function (s) {
|
|
92
|
-
return s.value;
|
|
93
|
-
}) || [1];
|
|
94
|
-
object.scaleLocal(1, 1, newScale[0] / oldScale[0]);
|
|
95
|
-
} else if (t === 'scale3d') {
|
|
96
|
-
var newScale = value && value.d && value.d.map(function (s) {
|
|
97
|
-
return s.value;
|
|
98
|
-
}) || [1, 1, 1];
|
|
99
|
-
var oldScale = old && old.d && old.d.map(function (s) {
|
|
100
|
-
return s.value;
|
|
101
|
-
}) || [1, 1, 1];
|
|
102
|
-
object.scaleLocal(newScale[0] / oldScale[0], newScale[1] / oldScale[1], newScale[2] / oldScale[2]);
|
|
103
|
-
} else if (t === 'translate') {
|
|
104
|
-
var newTranslation = value && value.d || [Opx, Opx];
|
|
105
|
-
var oldTranslation = old && old.d || [Opx, Opx];
|
|
106
|
-
object.translateLocal(newTranslation[0].value - oldTranslation[0].value, newTranslation[1].value - oldTranslation[1].value, 0);
|
|
107
|
-
} else if (t === 'translatex') {
|
|
108
|
-
var newTranslation = value && value.d || [Opx];
|
|
109
|
-
var oldTranslation = old && old.d || [Opx];
|
|
110
|
-
object.translateLocal(newTranslation[0].value - oldTranslation[0].value, 0, 0);
|
|
111
|
-
} else if (t === 'translatey') {
|
|
112
|
-
var newTranslation = value && value.d || [Opx];
|
|
113
|
-
var oldTranslation = old && old.d || [Opx];
|
|
114
|
-
object.translateLocal(0, newTranslation[0].value - oldTranslation[0].value, 0);
|
|
115
|
-
} else if (t === 'translatez') {
|
|
116
|
-
var newTranslation = value && value.d || [Opx];
|
|
117
|
-
var oldTranslation = old && old.d || [Opx];
|
|
118
|
-
object.translateLocal(0, 0, newTranslation[0].value - oldTranslation[0].value);
|
|
119
|
-
} else if (t === 'translate3d') {
|
|
120
|
-
var newTranslation = value && value.d || [Opx, Opx, Opx];
|
|
121
|
-
var oldTranslation = old && old.d || [Opx, Opx, Opx];
|
|
122
|
-
object.translateLocal(newTranslation[0].value - oldTranslation[0].value, newTranslation[1].value - oldTranslation[1].value, newTranslation[2].value - oldTranslation[2].value);
|
|
123
|
-
} else if (t === 'rotate') {
|
|
124
|
-
var newAngles = value && value.d || [Odeg];
|
|
125
|
-
var oldAngles = old && old.d || [Odeg];
|
|
126
|
-
object.rotateLocal(0, 0, newAngles[0].value - oldAngles[0].value);
|
|
127
|
-
} else if (t === 'rotatex') {
|
|
128
|
-
var newAngles = value && value.d || [Odeg];
|
|
129
|
-
var oldAngles = old && old.d || [Odeg];
|
|
130
|
-
object.rotateLocal(newAngles[0].value - oldAngles[0].value, 0, 0);
|
|
131
|
-
} else if (t === 'rotatey') {
|
|
132
|
-
var newAngles = value && value.d || [Odeg];
|
|
133
|
-
var oldAngles = old && old.d || [Odeg];
|
|
134
|
-
object.rotateLocal(0, newAngles[0].value - oldAngles[0].value, 0);
|
|
135
|
-
} else if (t === 'rotatez') {
|
|
136
|
-
var newAngles = value && value.d || [Odeg];
|
|
137
|
-
var oldAngles = old && old.d || [Odeg];
|
|
138
|
-
object.rotateLocal(0, 0, newAngles[0].value - oldAngles[0].value);
|
|
139
|
-
} else if (t === 'rotate3d') {// 暂不支持绕指定轴旋转
|
|
140
|
-
// const newAngles = value && value.d || [Odeg, Odeg, Odeg];
|
|
141
|
-
// const oldAngles = old && old.d || [Odeg, Odeg, Odeg];
|
|
142
|
-
// object.rotateLocal(
|
|
143
|
-
// newAngles[0].value - oldAngles[0].value,
|
|
144
|
-
// newAngles[1].value - oldAngles[1].value,
|
|
145
|
-
// newAngles[2].value - oldAngles[2].value,
|
|
146
|
-
// );
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
return newValue;
|
|
121
|
+
}
|
|
150
122
|
};
|
|
151
123
|
|
|
152
124
|
CSSPropertyTransform = __decorate([singleton()], CSSPropertyTransform);
|
|
@@ -3,9 +3,13 @@ import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
|
|
|
3
3
|
import { DisplayObject } from './DisplayObject';
|
|
4
4
|
import type { CSSUnitValue } from '../css';
|
|
5
5
|
export interface CircleStyleProps extends BaseStyleProps {
|
|
6
|
+
cx?: number | string;
|
|
7
|
+
cy?: number | string;
|
|
6
8
|
r: number | string;
|
|
7
9
|
}
|
|
8
10
|
export interface ParsedCircleStyleProps extends ParsedBaseStyleProps {
|
|
11
|
+
cx: CSSUnitValue;
|
|
12
|
+
cy: CSSUnitValue;
|
|
9
13
|
r: CSSUnitValue;
|
|
10
14
|
}
|
|
11
15
|
export declare class Circle extends DisplayObject<CircleStyleProps, ParsedCircleStyleProps> {
|
|
@@ -5,7 +5,6 @@ import { Element } from '../dom/Element';
|
|
|
5
5
|
import type { DisplayObjectConfig, IChildNode } from '../dom/interfaces';
|
|
6
6
|
import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
|
|
7
7
|
import type { PropertyParseOptions } from '../css/StyleValueRegistry';
|
|
8
|
-
import { StyleValueRegistry } from '../css/StyleValueRegistry';
|
|
9
8
|
/**
|
|
10
9
|
* prototype chains: DisplayObject -> Element -> Node -> EventTarget
|
|
11
10
|
*
|
|
@@ -29,7 +28,7 @@ export declare class DisplayObject<StyleProps extends BaseStyleProps = any, Pars
|
|
|
29
28
|
* contains style props in constructor's params, eg. fill, stroke...
|
|
30
29
|
*/
|
|
31
30
|
config: DisplayObjectConfig<StyleProps>;
|
|
32
|
-
styleValueRegistry:
|
|
31
|
+
styleValueRegistry: any;
|
|
33
32
|
/**
|
|
34
33
|
* push to active animations after calling `animate()`
|
|
35
34
|
*/
|
|
@@ -117,14 +116,8 @@ export declare class DisplayObject<StyleProps extends BaseStyleProps = any, Pars
|
|
|
117
116
|
getLocalRotation(): quat;
|
|
118
117
|
getLocalTransform(): mat4;
|
|
119
118
|
getWorldTransform(): mat4;
|
|
119
|
+
setLocalTransform(transform: mat4): this;
|
|
120
120
|
resetLocalTransform(): void;
|
|
121
|
-
/**
|
|
122
|
-
* sync style.x/y when local position changed
|
|
123
|
-
*
|
|
124
|
-
* Mixins may not declare private/protected properties
|
|
125
|
-
* however, you can use ES2020 private fields
|
|
126
|
-
*/
|
|
127
|
-
private syncLocalPosition;
|
|
128
121
|
/**
|
|
129
122
|
* returns an array of all Animation objects affecting this element
|
|
130
123
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/getAnimations
|
|
@@ -10,23 +10,21 @@ import { createVec3, decompose, formatAttribute, fromRotationTranslationScale, g
|
|
|
10
10
|
import { dirtifyToRoot } from '../services';
|
|
11
11
|
import { MutationEvent } from '../dom/MutationEvent';
|
|
12
12
|
import { Rectangle } from '../shapes';
|
|
13
|
-
import { StyleValueRegistry } from '../css/
|
|
14
|
-
import { CSSUnitValue } from '../css';
|
|
13
|
+
import { StyleValueRegistry } from '../css/interfaces';
|
|
15
14
|
var DEFAULT_STYLE_PROPS = {
|
|
16
|
-
x: '',
|
|
17
|
-
y: '',
|
|
18
|
-
z: '',
|
|
19
15
|
anchor: [0, 0],
|
|
20
16
|
opacity: '',
|
|
21
17
|
fillOpacity: '',
|
|
22
18
|
strokeOpacity: '',
|
|
23
19
|
fill: '',
|
|
24
20
|
stroke: '',
|
|
21
|
+
transform: '',
|
|
25
22
|
transformOrigin: '',
|
|
26
23
|
visibility: '',
|
|
27
24
|
pointerEvents: '',
|
|
28
25
|
lineCap: '',
|
|
29
26
|
lineJoin: '',
|
|
27
|
+
increasedLineWidthForHitTesting: '0',
|
|
30
28
|
fontSize: '',
|
|
31
29
|
fontFamily: '',
|
|
32
30
|
fontStyle: '',
|
|
@@ -283,7 +281,6 @@ function (_super) {
|
|
|
283
281
|
}
|
|
284
282
|
|
|
285
283
|
this.sceneGraphService.setPosition(this, createVec3(position, y, z));
|
|
286
|
-
this.syncLocalPosition();
|
|
287
284
|
return this;
|
|
288
285
|
};
|
|
289
286
|
/**
|
|
@@ -301,7 +298,6 @@ function (_super) {
|
|
|
301
298
|
}
|
|
302
299
|
|
|
303
300
|
this.sceneGraphService.setLocalPosition(this, createVec3(position, y, z));
|
|
304
|
-
this.syncLocalPosition();
|
|
305
301
|
return this;
|
|
306
302
|
};
|
|
307
303
|
/**
|
|
@@ -319,7 +315,6 @@ function (_super) {
|
|
|
319
315
|
}
|
|
320
316
|
|
|
321
317
|
this.sceneGraphService.translate(this, createVec3(position, y, z));
|
|
322
|
-
this.syncLocalPosition();
|
|
323
318
|
return this;
|
|
324
319
|
};
|
|
325
320
|
/**
|
|
@@ -337,7 +332,6 @@ function (_super) {
|
|
|
337
332
|
}
|
|
338
333
|
|
|
339
334
|
this.sceneGraphService.translateLocal(this, createVec3(position, y, z));
|
|
340
|
-
this.syncLocalPosition();
|
|
341
335
|
return this;
|
|
342
336
|
};
|
|
343
337
|
|
|
@@ -496,26 +490,13 @@ function (_super) {
|
|
|
496
490
|
return this.sceneGraphService.getWorldTransform(this);
|
|
497
491
|
};
|
|
498
492
|
|
|
499
|
-
DisplayObject.prototype.
|
|
500
|
-
this.sceneGraphService.
|
|
493
|
+
DisplayObject.prototype.setLocalTransform = function (transform) {
|
|
494
|
+
this.sceneGraphService.setLocalTransform(this, transform);
|
|
495
|
+
return this;
|
|
501
496
|
};
|
|
502
|
-
/**
|
|
503
|
-
* sync style.x/y when local position changed
|
|
504
|
-
*
|
|
505
|
-
* Mixins may not declare private/protected properties
|
|
506
|
-
* however, you can use ES2020 private fields
|
|
507
|
-
*/
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
DisplayObject.prototype.syncLocalPosition = function () {
|
|
511
|
-
var localPosition = this.getLocalPosition();
|
|
512
|
-
this.attributes.x = localPosition[0];
|
|
513
|
-
this.attributes.y = localPosition[1];
|
|
514
|
-
this.attributes.z = localPosition[2]; // should not affect computed style
|
|
515
497
|
|
|
516
|
-
|
|
517
|
-
this.
|
|
518
|
-
this.parsedStyle.z = new CSSUnitValue(this.attributes.z, 'px');
|
|
498
|
+
DisplayObject.prototype.resetLocalTransform = function () {
|
|
499
|
+
this.sceneGraphService.resetLocalTransform(this);
|
|
519
500
|
}; // #endregion transformable
|
|
520
501
|
// #region animatable
|
|
521
502
|
|
|
@@ -3,10 +3,14 @@ import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
|
|
|
3
3
|
import { DisplayObject } from './DisplayObject';
|
|
4
4
|
import type { CSSUnitValue } from '../css';
|
|
5
5
|
export interface EllipseStyleProps extends BaseStyleProps {
|
|
6
|
+
cx?: number | string;
|
|
7
|
+
cy?: number | string;
|
|
6
8
|
rx: number | string;
|
|
7
9
|
ry: number | string;
|
|
8
10
|
}
|
|
9
11
|
export interface ParsedEllipseStyleProps extends ParsedBaseStyleProps {
|
|
12
|
+
cx: CSSUnitValue;
|
|
13
|
+
cy: CSSUnitValue;
|
|
10
14
|
rx: CSSUnitValue;
|
|
11
15
|
ry: CSSUnitValue;
|
|
12
16
|
}
|