@next2d/display 2.2.2 → 2.3.1
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/package.json +9 -9
- package/src/DisplayObject/usecase/DisplayObjectGetRotationUseCase.js +1 -1
- package/src/DisplayObject/usecase/DisplayObjectGetScaleXUseCase.js +2 -10
- package/src/DisplayObject/usecase/DisplayObjectGetScaleYUseCase.js +3 -11
- package/src/DisplayObject/usecase/DisplayObjectSetScaleXUseCase.js +3 -10
- package/src/DisplayObject/usecase/DisplayObjectSetScaleYUseCase.js +3 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next2d/display",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "Next2D Display Package",
|
|
5
5
|
"author": "Toshiyuki Ienaga<ienaga@next2d.app> (https://github.com/ienaga/)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"url": "git+https://github.com/Next2D/Player.git"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@next2d/ui": "2.
|
|
28
|
-
"@next2d/text": "2.
|
|
29
|
-
"@next2d/geom": "2.
|
|
30
|
-
"@next2d/media": "2.
|
|
31
|
-
"@next2d/net": "2.
|
|
32
|
-
"@next2d/events": "2.
|
|
33
|
-
"@next2d/filters": "2.
|
|
34
|
-
"@next2d/render-queue": "2.
|
|
27
|
+
"@next2d/ui": "2.3.1",
|
|
28
|
+
"@next2d/text": "2.3.1",
|
|
29
|
+
"@next2d/geom": "2.3.1",
|
|
30
|
+
"@next2d/media": "2.3.1",
|
|
31
|
+
"@next2d/net": "2.3.1",
|
|
32
|
+
"@next2d/events": "2.3.1",
|
|
33
|
+
"@next2d/filters": "2.3.1",
|
|
34
|
+
"@next2d/render-queue": "2.3.1"
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -19,5 +19,5 @@ export const execute = (display_object) => {
|
|
|
19
19
|
const matrix = display_object.$matrix
|
|
20
20
|
? display_object.$matrix.rawData
|
|
21
21
|
: displayObjectGetRawMatrixUseCase(display_object);
|
|
22
|
-
return matrix ? Math.atan2(matrix[1], matrix[0]) * $Rad2Deg : 0;
|
|
22
|
+
return matrix ? Math.atan2(matrix[1], Math.abs(matrix[0])) * $Rad2Deg : 0;
|
|
23
23
|
};
|
|
@@ -15,15 +15,7 @@ export const execute = (display_object) => {
|
|
|
15
15
|
if (!matrix) {
|
|
16
16
|
return 1;
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
+ matrix[1] * matrix[1]);
|
|
20
|
-
if (!Number.isInteger(xScale)) {
|
|
21
|
-
const value = xScale.toString();
|
|
22
|
-
const index = value.indexOf("e");
|
|
23
|
-
if (index !== -1) {
|
|
24
|
-
xScale = +value.slice(0, index);
|
|
25
|
-
}
|
|
26
|
-
xScale = Math.round(xScale * 100) / 100;
|
|
27
|
-
}
|
|
18
|
+
const xScale = Math.round(Math.sqrt(matrix[0] * matrix[0]
|
|
19
|
+
+ matrix[1] * matrix[1]) * 10000) / 10000;
|
|
28
20
|
return 0 > matrix[0] ? xScale * -1 : xScale;
|
|
29
21
|
};
|
|
@@ -15,15 +15,7 @@ export const execute = (display_object) => {
|
|
|
15
15
|
if (!matrix) {
|
|
16
16
|
return 1;
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
+ matrix[3] * matrix[3]);
|
|
20
|
-
|
|
21
|
-
const value = yScale.toString();
|
|
22
|
-
const index = value.indexOf("e");
|
|
23
|
-
if (index !== -1) {
|
|
24
|
-
yScale = +value.slice(0, index);
|
|
25
|
-
}
|
|
26
|
-
yScale = Math.round(yScale * 100) / 100;
|
|
27
|
-
}
|
|
28
|
-
return 0 > matrix[0] ? yScale * -1 : yScale;
|
|
18
|
+
const yScale = Math.round(Math.sqrt(matrix[2] * matrix[2]
|
|
19
|
+
+ matrix[3] * matrix[3]) * 10000) / 10000;
|
|
20
|
+
return 0 > matrix[3] ? yScale * -1 : yScale;
|
|
29
21
|
};
|
|
@@ -14,15 +14,8 @@ import { execute as displayObjectGetRawMatrixUseCase } from "../usecase/DisplayO
|
|
|
14
14
|
*/
|
|
15
15
|
export const execute = (display_object, scale_x) => {
|
|
16
16
|
scale_x = $clamp(scale_x, -Number.MAX_VALUE, Number.MAX_VALUE, 1);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const index = value.indexOf("e");
|
|
20
|
-
if (index !== -1) {
|
|
21
|
-
scale_x = +value.slice(0, index);
|
|
22
|
-
}
|
|
23
|
-
scale_x = Math.round(scale_x * 100) / 100;
|
|
24
|
-
}
|
|
25
|
-
if (display_object.$scaleX === scale_x) {
|
|
17
|
+
const scaleX = Math.round(scale_x * 10000) / 10000;
|
|
18
|
+
if (display_object.$scaleX === scaleX) {
|
|
26
19
|
return;
|
|
27
20
|
}
|
|
28
21
|
let matrix = display_object.$matrix;
|
|
@@ -43,6 +36,6 @@ export const execute = (display_object, scale_x) => {
|
|
|
43
36
|
matrix.b = scale_x * Math.sin(radianX);
|
|
44
37
|
matrix.a = scale_x * Math.cos(radianX);
|
|
45
38
|
}
|
|
46
|
-
display_object.$scaleX =
|
|
39
|
+
display_object.$scaleX = scaleX;
|
|
47
40
|
displayObjectApplyChangesService(display_object);
|
|
48
41
|
};
|
|
@@ -14,15 +14,8 @@ import { execute as displayObjectGetRawMatrixUseCase } from "../usecase/DisplayO
|
|
|
14
14
|
*/
|
|
15
15
|
export const execute = (display_object, scale_y) => {
|
|
16
16
|
scale_y = $clamp(scale_y, -Number.MAX_VALUE, Number.MAX_VALUE, 1);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const index = value.indexOf("e");
|
|
20
|
-
if (index !== -1) {
|
|
21
|
-
scale_y = +value.slice(0, index);
|
|
22
|
-
}
|
|
23
|
-
scale_y = Math.round(scale_y * 100) / 100;
|
|
24
|
-
}
|
|
25
|
-
if (display_object.$scaleY === scale_y) {
|
|
17
|
+
const scaleY = Math.round(scale_y * 10000) / 10000;
|
|
18
|
+
if (display_object.$scaleY === scaleY) {
|
|
26
19
|
return;
|
|
27
20
|
}
|
|
28
21
|
let matrix = display_object.$matrix;
|
|
@@ -43,6 +36,6 @@ export const execute = (display_object, scale_y) => {
|
|
|
43
36
|
matrix.c = -scale_y * Math.sin(radianY);
|
|
44
37
|
matrix.d = scale_y * Math.cos(radianY);
|
|
45
38
|
}
|
|
46
|
-
display_object.$scaleY =
|
|
39
|
+
display_object.$scaleY = scaleY;
|
|
47
40
|
displayObjectApplyChangesService(display_object);
|
|
48
41
|
};
|