refactor: Add removeMouseLines

This commit is contained in:
yoosangwook 2024-08-21 18:27:10 +09:00
parent 26a3f07534
commit 813c756727
2 changed files with 2 additions and 1 deletions

View File

@ -629,7 +629,7 @@ export default function Roof2() {
</Button> </Button>
</> </>
)} )}
<Button className="m-1 p-2" onClick={saveImage}> <Button className="m-1 p-2" onClick={() => saveImage('title')}>
저장 저장
</Button> </Button>
{/*<Button className="m-1 p-2" onClick={rotateShape}> {/*<Button className="m-1 p-2" onClick={rotateShape}>

View File

@ -498,6 +498,7 @@ export function useCanvas(id) {
* @param {string} title - 저장할 이미지 이름 * @param {string} title - 저장할 이미지 이름
*/ */
const saveImage = async (title = 'canvas') => { const saveImage = async (title = 'canvas') => {
removeMouseLines()
await writeImage(title, canvas?.toDataURL('image/png').replace('data:image/png;base64,', '')) await writeImage(title, canvas?.toDataURL('image/png').replace('data:image/png;base64,', ''))
.then((res) => { .then((res) => {
console.log('success', res) console.log('success', res)