提交 cac48b2a 编写于 作者: Q qq_41923622

Thu Feb 6 13:55:00 CST 2025 inscode

上级 fc52c272
......@@ -18,7 +18,7 @@ const useDownload = () => {
const { canvasInstanceRef, canvasEl, onDownLoad } = useContext(EditorContext);
const handleDownload = (auto: boolean = false) => {
console.log('heheh');
const canvas = canvasInstanceRef.current;
......@@ -65,6 +65,9 @@ const useDownload = () => {
if(object.type === 'arrow'){
annotation.pointList=[object.x1, object.y1, object.x2, object.y2]
}
if(object.type === 'path'){
annotation.path = object.path
}
annotations.push(annotation);
})
// 打印标注信息
......
......@@ -65,6 +65,14 @@ function annotationsInit(annotations,canvas,historyRef){
});
newObject.strokeUniform = true;
break;
case 'path' :
newObject = new fabric.Path(annotation.path, {
fill: annotation.fill,
stroke: annotation.stroke,
strokeWidth: annotation.size,
opacity: annotation.opacity || 1
});
break;
// 可以根据需要添加更多元素类型的处理
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册