How can a custom button be used to switch the brush type to circle, arrow, line, etc.? I haven't found a method in JavaScript to control the brush type switch. #82
Unanswered
PineSongCN
asked this question in
Q&A
Replies: 2 comments 1 reply
-
This can be done with import { PenTool, Editor, makeOutlinedCircleBuilder } from 'js-draw';
const editor = new Editor(document.body);
const firstPen = editor.toolController.getMatchingTools(PenTool)[0];
firstPen.setStrokeFactory(makeOutlinedCircleBuilder); There isn't currently a way to get the list of default brush types. See also:
|
Beta Was this translation helpful? Give feedback.
1 reply
-
@personalizedrefrigerator I meant that I customized a few buttons outside the editor, and changed the editor's brush type after clicking the buttons. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How can a custom button be used to switch the brush type to circle, arrow, line, etc.? I haven't found a method in JavaScript to control the brush type switch.
Beta Was this translation helpful? Give feedback.
All reactions