1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.scaleInY = exports.scaleInX = void 0;
|
4 | var matrix_util_1 = require("@antv/matrix-util");
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | function scaleInX(shape, animateCfg, cfg) {
|
13 | var box = shape.getBBox();
|
14 | var mappingData = shape.get('origin').mappingData;
|
15 | var points = mappingData.points;
|
16 |
|
17 | var x = points[0].y - points[1].y > 0 ? box.maxX : box.minX;
|
18 | var y = (box.minY + box.maxY) / 2;
|
19 | shape.applyToMatrix([x, y, 1]);
|
20 | var matrix = matrix_util_1.ext.transform(shape.getMatrix(), [
|
21 | ['t', -x, -y],
|
22 | ['s', 0.01, 1],
|
23 | ['t', x, y],
|
24 | ]);
|
25 | shape.setMatrix(matrix);
|
26 | shape.animate({
|
27 | matrix: matrix_util_1.ext.transform(shape.getMatrix(), [
|
28 | ['t', -x, -y],
|
29 | ['s', 100, 1],
|
30 | ['t', x, y],
|
31 | ]),
|
32 | }, animateCfg);
|
33 | }
|
34 | exports.scaleInX = scaleInX;
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | function scaleInY(shape, animateCfg, cfg) {
|
43 | var box = shape.getBBox();
|
44 | var mappingData = shape.get('origin').mappingData;
|
45 | var x = (box.minX + box.maxX) / 2;
|
46 | var points = mappingData.points;
|
47 |
|
48 | var y = points[0].y - points[1].y <= 0 ? box.maxY : box.minY;
|
49 | shape.applyToMatrix([x, y, 1]);
|
50 | var matrix = matrix_util_1.ext.transform(shape.getMatrix(), [
|
51 | ['t', -x, -y],
|
52 | ['s', 1, 0.01],
|
53 | ['t', x, y],
|
54 | ]);
|
55 | shape.setMatrix(matrix);
|
56 | shape.animate({
|
57 | matrix: matrix_util_1.ext.transform(shape.getMatrix(), [
|
58 | ['t', -x, -y],
|
59 | ['s', 1, 100],
|
60 | ['t', x, y],
|
61 | ]),
|
62 | }, animateCfg);
|
63 | }
|
64 | exports.scaleInY = scaleInY;
|
65 |
|
\ | No newline at end of file |