Merge pull request #13747 from theduckylittle/feature/add-setters-to-shape-styles
Add setFill and setStroke to Shapes
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user