mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 02:03:47 +08:00
As the 'anchor' of the Transformer is undefined when there is no anchor (such as 'top-left', 'top-center', etc.), the code 'anchor.setAttrs(attrs)' causes an error: 'Cannot read properties of undefined (reading 'setAttrs')'.
Therefore, I want to add an if statement to check for the existence of the 'anchor' before setting its attributes.
This commit is contained in:
parent
3c0c6c8a3e
commit
83482a2440
@ -1120,7 +1120,7 @@ export class Transformer extends Group {
|
||||
|
||||
_batchChangeChild(selector: string, attrs: any) {
|
||||
const anchor = this.findOne(selector);
|
||||
anchor.setAttrs(attrs);
|
||||
if (anchor) anchor.setAttrs(attrs);
|
||||
}
|
||||
|
||||
update() {
|
||||
|
Loading…
Reference in New Issue
Block a user