diff --git a/ts/routes/image-occlusion/tools/lib.ts b/ts/routes/image-occlusion/tools/lib.ts index ab410cbad..740f135af 100644 --- a/ts/routes/image-occlusion/tools/lib.ts +++ b/ts/routes/image-occlusion/tools/lib.ts @@ -105,21 +105,6 @@ export const unGroupShapes = (canvas: fabric.Canvas): void => { redraw(canvas); }; -/** Check for the target within a (potentially nested) group - * NOTE: assumes that masks do not overlap */ -export const findTargetInGroup = (group: fabric.Group, p: fabric.Point): fabric.Object | undefined => { - if (!group) { return; } - const point = fabric.util.transformPoint(p, fabric.util.invertTransform(group.calcOwnMatrix())); - for (const shape of group.getObjects()) { - if (shape instanceof fabric.Group) { - const ret = findTargetInGroup(shape, point); - if (ret) { return ret; } - } else if (shape.containsPoint(point)) { - return shape; - } - } -}; - const copyItem = (canvas: fabric.Canvas): void => { const activeObject = canvas.getActiveObject(); if (!activeObject) { diff --git a/ts/routes/image-occlusion/tools/tool-fill.ts b/ts/routes/image-occlusion/tools/tool-fill.ts index 6b004edc8..0f94ec2e7 100644 --- a/ts/routes/image-occlusion/tools/tool-fill.ts +++ b/ts/routes/image-occlusion/tools/tool-fill.ts @@ -4,7 +4,7 @@ import { fabric } from "fabric"; import { get, type Readable } from "svelte/store"; -import { findTargetInGroup, stopDraw } from "./lib"; +import { stopDraw } from "./lib"; import { undoStack } from "./tool-undo-redo"; export const fillMask = (canvas: fabric.Canvas, colourStore: Readable): void => {