feat: allow update class from instance

This commit is contained in:
Anthony Fu
2024-02-21 11:55:10 +01:00
parent 55e575c8d1
commit 3c8605d04b

View File

@@ -40,6 +40,16 @@ class RoughAnnotationImpl implements RoughAnnotation {
}
}
get class() { return this._config.class; }
set class(value) {
if (this._config.class !== value) {
this._config.class = value;
if (this._svg) {
this._svg.setAttribute('class', ['rough-annotation', this._config.class || ''].filter(Boolean).join(' '));
}
}
}
get strokeWidth() { return this._config.strokeWidth; }
set strokeWidth(value) {
if (this._config.strokeWidth !== value) {