Konva.Transformer automatically track properties of attached nodes. So it will adopt its own properties automatically.
But in some cases Konva.Transformer can’t do this. Currently Konva.Transformer can not track deep changes inside Konva.Group node. In this case you will need to use forceUpdate method to reset transforming tools
Instructions: Click the button. See how transformer is changed.
<body> <divid="container"></div> <inputtype="button"id="button"value="Add random shape" /> <script> var width = window.innerWidth; var height = window.innerHeight;
var stage = new Konva.Stage({ container: 'container', width: width, height: height, });
var layer = new Konva.Layer(); stage.add(layer);
var group = new Konva.Group({ x: 50, y: 50, draggable: true, }); layer.add(group);
// create new transformer var tr = new Konva.Transformer(); layer.add(tr); tr.nodes([group]);