slidev
slidev copied to clipboard
How to config the drawing brush size?
I would like to use a customized brush size. However, I did not find anything about that in issues or documentation.
I can see two possible (non-exclusive) solutions for a PR:
- add a customization variable in the frontmatter
- add the ui to select the brush size
A workaround is to copy the content below in a new component, e.g. in components/DrauuConfig.vue
<script lang="ts" setup>
import { drauuOptions } from '@slidev/client/logic/drawings'
drauuOptions.brush.size = 2
</script>
(In case it would not work, instantiate this component at least once in your presentation, e.g. in the first slide put <DrauuConfig/>)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I also have this need. The workaround works, DrauuConfig must be placed at the beginning of the presentation
Desperately needing the brushSize control UI. Hoping that the dev team can give some consideration to it.
The workaround does not work on my machine and gives the following error:
Failed to load url /node_modules/.pnpm/registry.npmjs.org+@[email protected][email protected][email protected]/node_modules/@slidev/client/logic/drawings (resolved id: /home/xxx/slidev/node_modules/.pnpm/registry.npmjs.org+@[email protected][email protected][email protected]/node_modules/@slidev/client/logic/drawings) in /home/xxx/slidev/components/DrauuConfig.vue. Does the file exist?
It seems that appending .ts to the import path in components/DrauuConfig.vue will fix this error:
import { drauuOptions } from '@slidev/client/logic/drawings.ts'
I'm not familiar with nodejs and typescript, so I'm not sure if this is the right way to fix it.
@1024th adding the .ts should work. It is necessary since an update of the underlying of "vite" a few month ago (that was previously configured to add the .ts if needed).