Skip to content

Commit

Permalink
getTexturePixels
Browse files Browse the repository at this point in the history
  • Loading branch information
guozhaokui committed Nov 19, 2019
1 parent 3d9e0b5 commit f5b069e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/layaAir/laya/resource/Texture.ts
Expand Up @@ -358,13 +358,13 @@ export class Texture extends EventDispatcher {
return pix;
//否则只取一部分
var ret: Uint8Array = new Uint8Array(width * height * 4);
wstride = texw * 4;
st = x * 4;
dst = (y + height - 1) * wstride + x * 4;
let srcwstride = texw * 4;
st = 0;//x * 4;
dst = (y + height - 1) * srcwstride + x * 4;
for (i = height - 1; i >= 0; i--) {
ret.set(dt.slice(dst, dst + width * 4), st);
st += wstride;
dst -= wstride;
dst -= srcwstride;
}
return ret;
}
Expand Down

0 comments on commit f5b069e

Please sign in to comment.