Skip to content

Commit

Permalink
fix(pixel): update prepRegions()
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Jul 26, 2019
1 parent bb6ba47 commit ad8d2d7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/pixel/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ export const clampRegion = (
return [sx, sy, clamp(w, 0, maxw - sx), clamp(h, 0, maxh - sy), dx, dy];
};

const prepRegions = (
src: IPixelBuffer<TypedArray, number>,
dest: IPixelBuffer<TypedArray, number>,
export const prepRegions = (
src: { width: number; height: number },
dest: { width: number; height: number },
opts: Partial<BlitOpts> = {}
) => {
let sw = src.width;
Expand All @@ -243,7 +243,9 @@ const prepRegions = (
rw,
rh,
dw,
dest.height
dest.height,
sx,
sy
);
return { sx, sy, dx, dy, rw, rh };
};

0 comments on commit ad8d2d7

Please sign in to comment.