mirror of
https://github.com/zsviczian/obsidian-excalidraw-plugin.git
synced 2025-08-06 05:46:28 +00:00
22 lines
1003 B
Markdown
22 lines
1003 B
Markdown
/*
|
|
|
|

|
|
|
|
Download this file and save to your Obsidian Vault including the first line, or open it in "Raw" and copy the entire contents to Obsidian.
|
|
|
|

|
|
|
|
This script will set the stroke width of selected elements. This is helpful, for example, when you scale freedraw sketches and want to reduce or increase their line width.
|
|
|
|
See documentation for more details:
|
|
https://zsviczian.github.io/obsidian-excalidraw-plugin/ExcalidrawScriptsEngine.html
|
|
|
|
```javascript
|
|
*/
|
|
let width = (ea.getViewSelectedElement().strokeWidth??1).toString();
|
|
width = await utils.inputPrompt("Width?","number",width);
|
|
const elements=ea.getViewSelectedElements();
|
|
ea.copyViewElementsToEAforEditing(elements);
|
|
ea.getElements().forEach((el)=>el.strokeWidth=width);
|
|
ea.addElementsToView();
|