fix transformstart event. close #1294

This commit is contained in:
Anton Lavrenov 2022-03-08 11:00:28 -05:00
parent 427f03fc07
commit a75fd53f0e
5 changed files with 52 additions and 24 deletions

View File

@ -3,6 +3,8 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
- Fix event object on `transformstart` event.
## 8.3.3 (2022-03-23)
- Fix `justify` align for text with several paragraphs.

View File

@ -198,9 +198,7 @@ export class Shape<
}
getContext() {
Util.warn(
'shape.getContext() method is deprecated. Please do not use it.'
);
Util.warn('shape.getContext() method is deprecated. Please do not use it.');
return this.getLayer().getContext();
}
getCanvas() {

View File

@ -649,9 +649,9 @@ export class Transformer extends Group {
x: pos.x - ap.x,
y: pos.y - ap.y,
};
this._fire('transformstart', { evt: e, target: this.getNode() });
this._fire('transformstart', { evt: e.evt, target: this.getNode() });
this._nodes.forEach((target) => {
target._fire('transformstart', { evt: e, target });
target._fire('transformstart', { evt: e.evt, target });
});
}
_handleMouseMove(e) {

File diff suppressed because one or more lines are too long

View File

@ -2509,7 +2509,7 @@ describe('Transformer', function () {
});
});
it('transform events check', function () {
it.only('transform events check', function () {
var stage = addStage();
var layer = new Konva.Layer();
stage.add(layer);
@ -2535,6 +2535,7 @@ describe('Transformer', function () {
callCount += 1;
assert.equal(e.target, rect);
assert.equal(tr.getActiveAnchor(), 'top-left');
assert.equal(typeof e.evt.clientX === 'number', true);
});
rect.on('transform', function (e) {