Merge pull request #13747 from theduckylittle/feature/add-setters-to-shape-styles

Add setFill and setStroke to Shapes
This commit is contained in:
Tim Schaub
2022-07-02 16:16:03 -06:00
committed by GitHub
5 changed files with 82 additions and 0 deletions

View File

@@ -200,6 +200,16 @@ 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;
this.render();
}
/**
* @return {HTMLCanvasElement} Image element.
*/
@@ -309,6 +319,16 @@ 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;
this.render();
}
/**
* @param {function(import("../events/Event.js").default): void} listener Listener function.
*/