File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -143,17 +143,6 @@ var Frame = new Class({
143143 this . updateUVs ( ) ;
144144 } ,
145145
146- setCut : function ( x , y , width , height )
147- {
148- this . cutX = x ;
149- this . cutY = y ;
150-
151- this . cutWidth = width ;
152- this . cutHeight = height ;
153-
154- return this . updateUVs ( ) ;
155- } ,
156-
157146 /**
158147 * If the frame was trimmed when added to the Texture Atlas, this records the trim and source data.
159148 *
@@ -198,14 +187,36 @@ var Frame = new Class({
198187 return this . updateUVs ( ) ;
199188 } ,
200189
190+ setCut : function ( x , y , width , height )
191+ {
192+ this . cutX = x ;
193+ this . cutY = y ;
194+
195+ this . cutWidth = width ;
196+ this . cutHeight = height ;
197+
198+ return this . updateUVs ( ) ;
199+ } ,
200+
201201 /**
202- * Updates the internal WebGL UV cache.
202+ * Updates the internal WebGL UV cache and the drawImage cache .
203203 *
204204 * @method updateUVs
205205 * @private
206206 */
207207 updateUVs : function ( )
208208 {
209+ // Canvas data
210+
211+ var cd = this . data . drawImage ;
212+
213+ cd . sWidth = this . cutWidth ;
214+ cd . sHeight = this . cutHeight ;
215+ cd . dWidth = this . cutWidth ;
216+ cd . dHeight = this . cutHeight ;
217+
218+ // WebGL data
219+
209220 var tw = this . source . width ;
210221 var th = this . source . height ;
211222 var uvs = this . data . uvs ;
You can’t perform that action at this time.
0 commit comments