File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,6 +65,11 @@ var Frame = new Class({
6565 */
6666 this . height = height ;
6767
68+ // The half sizes of this frame (to save in constant calculations in the renderer)
69+ this . halfWidth = width * 0.5 ;
70+
71+ this . halfHeight = height * 0.5 ;
72+
6873 /**
6974 * @property {number } width - The rendering width of this Frame, taking trim into account.
7075 */
@@ -173,6 +178,9 @@ var Frame = new Class({
173178 this . width = destWidth ;
174179 this . height = destHeight ;
175180
181+ this . halfWidth = destWidth * 0.5 ;
182+ this . halfHeight = destHeight * 0.5 ;
183+
176184 this . centerX = Math . floor ( destWidth / 2 ) ;
177185 this . centerY = Math . floor ( destHeight / 2 ) ;
178186
@@ -250,6 +258,9 @@ var Frame = new Class({
250258 clone . width = this . width ;
251259 clone . height = this . height ;
252260
261+ clone . halfWidth = this . halfWidth ;
262+ clone . halfHeight = this . halfHeight ;
263+
253264 clone . centerX = this . centerX ;
254265 clone . centerY = this . centerY ;
255266
You can’t perform that action at this time.
0 commit comments