mirror of
https://github.com/ankitects/anki.git
synced 2026-01-12 21:44:01 -05:00
remove unused findTargetInGroup
This commit is contained in:
parent
d4d316c3f6
commit
d922ed9636
2 changed files with 1 additions and 16 deletions
|
|
@ -105,21 +105,6 @@ export const unGroupShapes = (canvas: fabric.Canvas): void => {
|
||||||
redraw(canvas);
|
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 copyItem = (canvas: fabric.Canvas): void => {
|
||||||
const activeObject = canvas.getActiveObject();
|
const activeObject = canvas.getActiveObject();
|
||||||
if (!activeObject) {
|
if (!activeObject) {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
import { fabric } from "fabric";
|
import { fabric } from "fabric";
|
||||||
|
|
||||||
import { get, type Readable } from "svelte/store";
|
import { get, type Readable } from "svelte/store";
|
||||||
import { findTargetInGroup, stopDraw } from "./lib";
|
import { stopDraw } from "./lib";
|
||||||
import { undoStack } from "./tool-undo-redo";
|
import { undoStack } from "./tool-undo-redo";
|
||||||
|
|
||||||
export const fillMask = (canvas: fabric.Canvas, colourStore: Readable<string>): void => {
|
export const fillMask = (canvas: fabric.Canvas, colourStore: Readable<string>): void => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue