Fix selected shapes shifting to canvas origin

This commit is contained in:
hikaru-y 2023-10-13 06:24:03 +09:00
parent 6c2205663e
commit d81b96fed0

View file

@ -36,6 +36,10 @@ export function exportShapesToClozeDeletions(occludeInactive: boolean): {
*/
function baseShapesFromFabric(occludeInactive: boolean): ShapeOrShapes[] {
const canvas = globalThis.canvas as Canvas;
// Prevents multiple shapes in 'activeSelection' from shifting to the canvas origin
canvas.discardActiveObject();
makeMaskTransparent(canvas, false);
const objects = canvas.getObjects() as FabricObject[];
return objects