File tree Expand file tree Collapse file tree
v3/src/gameobjects/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,33 +7,9 @@ var Origin = {
77 originX : 0.5 ,
88 originY : 0.5 ,
99
10- displayOriginX : {
11-
12- get : function ( )
13- {
14- return Math . round ( ( this . width * this . originX ) * this . scaleX ) ;
15- } ,
16-
17- set : function ( value )
18- {
19- this . originX = this . width / value ;
20- }
21-
22- } ,
23-
24- displayOriginY : {
25-
26- get : function ( )
27- {
28- return Math . round ( ( this . height * this . originY ) * this . scaleY ) ;
29- } ,
30-
31- set : function ( value )
32- {
33- this . originY = this . height / value ;
34- }
35-
36- } ,
10+ // READ ONLY
11+ displayOriginX : 0 ,
12+ displayOriginY : 0 ,
3713
3814 setOrigin : function ( x , y )
3915 {
@@ -43,7 +19,7 @@ var Origin = {
4319 this . originX = x ;
4420 this . originY = y ;
4521
46- return this ;
22+ return this . updateOrigin ( ) ;
4723 } ,
4824
4925 setDisplayOrigin : function ( x , y )
@@ -54,6 +30,17 @@ var Origin = {
5430 this . displayOriginX = x ;
5531 this . displayOriginY = y ;
5632
33+ this . originX = this . width / x ;
34+ this . originY = this . height / y ;
35+
36+ return this ;
37+ } ,
38+
39+ updateOrigin : function ( )
40+ {
41+ this . displayOriginX = Math . round ( this . originX * this . width ) ;
42+ this . displayOriginY = Math . round ( this . originY * this . height ) ;
43+
5744 return this ;
5845 }
5946
You can’t perform that action at this time.
0 commit comments