fix: update selected elements on set color

This commit is contained in:
Konstantinos Kaloutas
2022-11-17 17:24:08 +02:00
parent f90cee54b1
commit 4d7f68fe66

View File

@@ -168,13 +168,27 @@ export class TLApi<S extends TLShape = TLShape, K extends TLEventMap = TLEventMa
setColor = (color: string): this => {
const { settings } = this.app
settings.update({ color: color })
this.app.selectedShapesArray.forEach(s => {
s.update({ fill: color, stroke: color })
})
this.app.persist()
return this
}
setOpacity = (opacity: number): this => {
const { settings } = this.app
settings.update({ opacity: opacity })
this.app.selectedShapesArray.forEach(s => {
s.update({ opacity: opacity })
})
this.app.persist()
return this
}