@@ -13,11 +13,12 @@ import {
1313 handleCanvasObjectScaling ,
1414 handleCanvasSelectionCreated ,
1515 handleCanvaseMouseMove ,
16+ handlePathCreated ,
1617 handleResize ,
1718 initializeFabric ,
1819 renderCanvas ,
1920} from "@/lib/canvas" ;
20- import { ActiveElement , Attributes } from "@/types/type " ;
21+ import { ActiveElement , Attributes } from "@/types" ;
2122import { useMutation , useRedo , useStorage , useUndo } from "@/liveblocks.config" ;
2223import { LiveMap } from "@liveblocks/client" ;
2324import { defaultNavElement } from "@/constants" ;
@@ -151,24 +152,31 @@ export default function Home() {
151152 } ) ;
152153 } ) ;
153154
155+ canvas . on ( "path:created" , ( options : any ) => {
156+ handlePathCreated ( {
157+ options,
158+ syncShapeInStorage,
159+ } ) ;
160+ } ) ;
161+
154162 canvas . on ( "object:modified" , ( options : any ) => {
155163 handleCanvasObjectModified ( {
156164 options,
157165 syncShapeInStorage,
158166 } ) ;
159167 } ) ;
160168
161- canvas . on ( "selection:created " , ( options : any ) => {
162- handleCanvasSelectionCreated ( {
169+ canvas . on ( "object:scaling " , ( options : any ) => {
170+ handleCanvasObjectScaling ( {
163171 options,
164- isEditingRef,
165172 setElementAttributes,
166173 } ) ;
167174 } ) ;
168175
169- canvas . on ( "object:scaling " , ( options : any ) => {
170- handleCanvasObjectScaling ( {
176+ canvas . on ( "selection:created " , ( options : any ) => {
177+ handleCanvasSelectionCreated ( {
171178 options,
179+ isEditingRef,
172180 setElementAttributes,
173181 } ) ;
174182 } ) ;
0 commit comments