fix evt property when transformer is used. fix #981

This commit is contained in:
Anton Lavrenov 2020-09-14 13:01:45 -05:00
parent c36c8b7da9
commit 1edb5ef55c
4 changed files with 51 additions and 1323 deletions

View File

@ -3,6 +3,7 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
* fixes for `dragstart` event when `Konva.Transformer` is used. `dragstart` event will have correct native `evt` reference
* Better unicode support in `Konva.Text` and `Konva.TextPath`. Emoji should work better now 👍
## 7.1.0

1366
konva.js

File diff suppressed because it is too large Load Diff

View File

@ -347,7 +347,7 @@ export class Transformer extends Group {
x: otherAbs.x + dx,
y: otherAbs.y + dy,
});
otherNode.startDrag();
otherNode.startDrag(e);
});
lastPos = null;
});

View File

@ -3856,7 +3856,7 @@ suite('Transformer', function () {
assert.almostEqual(tr.y(), 100);
});
test('drag several nodes', function () {
test.only('drag several nodes', function () {
var stage = addStage();
var layer = new Konva.Layer();
stage.add(layer);
@ -3914,7 +3914,8 @@ suite('Transformer', function () {
// also drag should bubble to stage
// two times for two rects
stage.on('dragstart', () => {
stage.on('dragstart', (e) => {
assert.equal(!!e.evt, true);
dragstart += 1;
});