-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
@luileito thanks for a great plugin. Super easy to use.
I have the following code in the mousedownBefore event.
mousedownBefore: function (elem, data, evt) {
var brushType = getBrushType();
if (brushType == 'eraser') {
// There is a method to set the brush in eraser mode.
data.options.graphics.lineWidth = 20;
data.sketch.eraser();
} else if (brushType == 'pencil') {
const color = getBrushColor() ?? "black";
// There is a method to get the default mode (pencil) back.
data.options.graphics.lineWidth = 2;
data.options.graphics.strokeStyle = color;
data.sketch.saveGraphics(data.options.graphics);
data.sketch.pencil();
}
}The function named getBrushColor is similar to your getBrushType function. It returns a HEX color of the color selected on the page.
Example UI:
However, when I execute the "svg.create" method the contents returned only use black.
Am I doing something wrong? Is this supported?
Metadata
Metadata
Assignees
Labels
No labels
