remove unused findTargetInGroup

This commit is contained in:
llama 2025-07-23 17:27:35 +08:00
parent d4d316c3f6
commit d922ed9636
No known key found for this signature in database
GPG key ID: 0B7543854B9413C3
2 changed files with 1 additions and 16 deletions

View file

@ -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) {

View file

@ -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<string>): void => {