Skip to content

Commit 815e593

Browse files
fix(ui): type error in canvas worker
1 parent 2e025ed commit 815e593

File tree

1 file changed

+4
-4
lines changed
  • invokeai/frontend/web/src/features/controlLayers/konva

1 file changed

+4
-4
lines changed

invokeai/frontend/web/src/features/controlLayers/konva/worker.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ export type Extents = {
1010

1111
/**
1212
* Get the bounding box of an image.
13-
* @param buffer The ArrayBuffer of the image to get the bounding box of.
13+
* @param buffer The ArrayBufferLike of the image to get the bounding box of.
1414
* @param width The width of the image.
1515
* @param height The height of the image.
1616
* @returns The minimum and maximum x and y values of the image's bounding box, or null if the image has no pixels.
1717
*/
18-
const getImageDataBboxArrayBuffer = (buffer: ArrayBuffer, width: number, height: number): Extents | null => {
18+
const getImageDataBboxArrayBufferLike = (buffer: ArrayBufferLike, width: number, height: number): Extents | null => {
1919
let minX = width;
2020
let minY = height;
2121
let maxX = -1;
@@ -50,7 +50,7 @@ const getImageDataBboxArrayBuffer = (buffer: ArrayBuffer, width: number, height:
5050

5151
export type GetBboxTask = {
5252
type: 'get_bbox';
53-
data: { id: string; buffer: ArrayBuffer; width: number; height: number };
53+
data: { id: string; buffer: ArrayBufferLike; width: number; height: number };
5454
};
5555

5656
type TaskWithTimestamps<T extends Record<string, unknown>> = T & { started: number | null; finished: number | null };
@@ -95,7 +95,7 @@ function processNextTask() {
9595
// Process the task
9696
if (task.type === 'get_bbox') {
9797
const { buffer, width, height, id } = task.data;
98-
const extents = getImageDataBboxArrayBuffer(buffer, width, height);
98+
const extents = getImageDataBboxArrayBufferLike(buffer, width, height);
9999
const result: ExtentsResult = {
100100
type: 'extents',
101101
data: { id, extents },

0 commit comments

Comments
 (0)