fix transform on double touch, fix #1767

This commit is contained in:
Anton Lavrenov 2024-06-20 09:59:21 -05:00
parent 8be222e80e
commit 83523ecc6f
2 changed files with 19 additions and 1 deletions

View File

@ -670,6 +670,11 @@ export class Transformer extends Group {
});
}
_handleMouseDown(e) {
// do nothing if we already transforming
// that is possible to trigger with multitouch
if (this._transforming) {
return;
}
this._movingAnchorName = e.target.name().split(' ')[0];
var attrs = this._getNodeRect();

View File

@ -48,12 +48,25 @@
x: 10,
y: 10,
text: 'Simple Text',
fontSize: 300,
fontSize: 100,
fontFamily: 'Calibri',
fill: 'green',
textDecoration: 'underline line-through',
draggable: true,
});
layer.add(text);
var tr = new Konva.Transformer({
nodes: [text],
});
layer.add(tr);
tr.on('transformstart', () => {
console.log('transform start');
});
tr.on('transformend', () => {
console.log('transform end');
});
</script>
</body>
</html>