Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(useDrauu): fix Eraser does not work #1753

Merged
merged 2 commits into from Jul 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/integrations/useDrauu/index.ts
@@ -1,6 +1,6 @@
import type { Ref } from 'vue-demi'
import { ref, watch } from 'vue-demi'
import type { Brush, Drauu, Options } from 'drauu'
import type { Brush, Drauu, DrawingMode, Options } from 'drauu'
import { createDrauu } from 'drauu'
import type { EventHookOn, MaybeElementRef } from '@vueuse/core'
import { createEventHook, unrefElement } from '@vueuse/core'
Expand Down Expand Up @@ -66,8 +66,10 @@ export function useDrauu(
watch(brush, () => {
const instance = drauuInstance.value

if (instance)
if (instance) {
instance.brush = brush.value
instance.mode = brush.value.mode as DrawingMode
}
}, { deep: true })

const undo = () => drauuInstance.value?.undo()
Expand Down