Skip to content

Commit

Permalink
fix transform on double touch, fix #1767
Browse files Browse the repository at this point in the history
  • Loading branch information
lavrton committed Jun 20, 2024
1 parent 8be222e commit 83523ec
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/shapes/Transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
15 changes: 14 additions & 1 deletion test/sandbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>

0 comments on commit 83523ec

Please sign in to comment.