From 72ef944b8b9830917745d49724878b7806ba8895 Mon Sep 17 00:00:00 2001 From: "Lu[ke] Wilson" Date: Fri, 24 Nov 2023 12:19:10 +0000 Subject: [PATCH] mask frame --- src/app/page.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/app/page.tsx b/src/app/page.tsx index a2dfb74..0bb725c 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -17,6 +17,15 @@ const tools = [LiveImageTool]; export default function Home() { const onEditorMount = (editor: Editor) => { + // @ts-expect-error: patch + editor.isShapeOfType = function (arg, type) { + const shape = typeof arg === "string" ? this.getShape(arg)! : arg; + if (shape.type === "live-image" && type === "frame") { + return true; + } + return shape.type === type; + }; + // If there isn't a live image shape, create one const liveImage = editor.getCurrentPageShapes().find((shape) => { return shape.type === "live-image";