mirror of
https://github.com/konvajs/konva.git
synced 2025-09-19 02:37:59 +08:00
fix transform on double touch, fix #1767
This commit is contained in:
@@ -670,6 +670,11 @@ export class Transformer extends Group {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
_handleMouseDown(e) {
|
_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];
|
this._movingAnchorName = e.target.name().split(' ')[0];
|
||||||
|
|
||||||
var attrs = this._getNodeRect();
|
var attrs = this._getNodeRect();
|
||||||
|
@@ -48,12 +48,25 @@
|
|||||||
x: 10,
|
x: 10,
|
||||||
y: 10,
|
y: 10,
|
||||||
text: 'Simple Text',
|
text: 'Simple Text',
|
||||||
fontSize: 300,
|
fontSize: 100,
|
||||||
fontFamily: 'Calibri',
|
fontFamily: 'Calibri',
|
||||||
fill: 'green',
|
fill: 'green',
|
||||||
textDecoration: 'underline line-through',
|
textDecoration: 'underline line-through',
|
||||||
|
draggable: true,
|
||||||
});
|
});
|
||||||
layer.add(text);
|
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>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Reference in New Issue
Block a user