mask frame
This commit is contained in:
parent
0b65af00bd
commit
72ef944b8b
|
|
@ -17,6 +17,15 @@ const tools = [LiveImageTool];
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
const onEditorMount = (editor: Editor) => {
|
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
|
// If there isn't a live image shape, create one
|
||||||
const liveImage = editor.getCurrentPageShapes().find((shape) => {
|
const liveImage = editor.getCurrentPageShapes().find((shape) => {
|
||||||
return shape.type === "live-image";
|
return shape.type === "live-image";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue