Add setFill and setStroke to Shapes

This rounds out the shape style sto be more
consistent and make the `setFill` and `setStroke`
methods available.
This commit is contained in:
Duck
2022-06-09 08:30:16 -07:00
parent 5dc07bd5b7
commit 4ef584b410

View File

@@ -200,6 +200,15 @@ class RegularShape extends ImageStyle {
return this.fill_;
}
/**
* Set the fill style.
* @param {import("./Fill.js").default} fill Fill style.
* @api
*/
setFill(fill) {
this.fill_ = fill;
}
/**
* @return {HTMLCanvasElement} Image element.
*/
@@ -309,6 +318,15 @@ class RegularShape extends ImageStyle {
return this.stroke_;
}
/**
* Set the stroke style.
* @param {import("./Stroke.js").default} stroke Stroke style.
* @api
*/
setStroke(stroke) {
this.stroke_ = stroke;
}
/**
* @param {function(import("../events/Event.js").default): void} listener Listener function.
*/