<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a1cacecfd7c0e1968f918f95">[email protected]</a>
does not provide an API for customizing specific anchors on a
Konva.Transformer
.
The code you have written may not work as expected, as the Konva.Transformer
can reset its style using the internal tr.update()
function at any time.
To address this issue, you can override the update
method and apply your own styles:
const tr = new Konva.Transformer({
nodes: [shape]
})
tr.update = function() {
Konva.Transformer.prototype.update.call(tr);
var rot = this.findOne('.rotater');
rot.fill('orange');
}
tr.forceUpdate();
layer.add(tr);
Check out the demo here: https://jsbin.com/lumisacayo/1/edit?html,js,output