File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -236,10 +236,12 @@ export var Component = registerComponent('screenshot', {
236236 var flippedPixels = pixels . slice ( 0 ) ;
237237 for ( var x = 0 ; x < width ; ++ x ) {
238238 for ( var y = 0 ; y < height ; ++ y ) {
239- flippedPixels [ x * 4 + y * width * 4 ] = pixels [ x * 4 + ( height - y ) * width * 4 ] ;
240- flippedPixels [ x * 4 + 1 + y * width * 4 ] = pixels [ x * 4 + 1 + ( height - y ) * width * 4 ] ;
241- flippedPixels [ x * 4 + 2 + y * width * 4 ] = pixels [ x * 4 + 2 + ( height - y ) * width * 4 ] ;
242- flippedPixels [ x * 4 + 3 + y * width * 4 ] = pixels [ x * 4 + 3 + ( height - y ) * width * 4 ] ;
239+ var from = x * 4 + ( height - y - 1 ) * width * 4 ;
240+ var to = x * 4 + y * width * 4 ;
241+ flippedPixels [ to ] = pixels [ from ] ;
242+ flippedPixels [ to + 1 ] = pixels [ from + 1 ] ;
243+ flippedPixels [ to + 2 ] = pixels [ from + 2 ] ;
244+ flippedPixels [ to + 3 ] = pixels [ from + 3 ] ;
243245 }
244246 }
245247 return flippedPixels ;
You can’t perform that action at this time.
0 commit comments