mirror of
https://github.com/ankitects/anki.git
synced 2026-01-13 05:53:53 -05:00
use canvas.targets instead of findTargetInGroup
This commit is contained in:
parent
c6c59a5e01
commit
d4d316c3f6
1 changed files with 1 additions and 3 deletions
|
|
@ -17,9 +17,7 @@ export const fillMask = (canvas: fabric.Canvas, colourStore: Readable<string>):
|
||||||
stopDraw(canvas);
|
stopDraw(canvas);
|
||||||
|
|
||||||
canvas.on("mouse:down", function(o) {
|
canvas.on("mouse:down", function(o) {
|
||||||
const target = o.target instanceof fabric.Group
|
const target = o.target instanceof fabric.Group ? canvas.targets[0] : o.target;
|
||||||
? findTargetInGroup(o.target, canvas.getPointer(o.e) as fabric.Point)
|
|
||||||
: o.target;
|
|
||||||
const colour = get(colourStore);
|
const colour = get(colourStore);
|
||||||
if (!target || target.fill === colour) { return; }
|
if (!target || target.fill === colour) { return; }
|
||||||
target.fill = colour;
|
target.fill = colour;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue