mirror of
https://github.com/konvajs/konva.git
synced 2025-07-15 16:33:15 +08:00
update CHANGELOG with new version
This commit is contained in:
parent
8bf97ba8c1
commit
b5e7362d26
@ -3,6 +3,9 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
|
## 7.0.3 - 2020-07-09
|
||||||
|
|
||||||
|
* Fix wring `dragend` trigger on `draggable` property change inside `click`
|
||||||
* Fix incorrect text rendering with `letterSpacing !== 0`
|
* Fix incorrect text rendering with `letterSpacing !== 0`
|
||||||
* Typescript fixes
|
* Typescript fixes
|
||||||
|
|
||||||
|
4
konva.min.js
vendored
4
konva.min.js
vendored
File diff suppressed because one or more lines are too long
@ -64,10 +64,10 @@ export class Layer extends Container<Group | Shape> {
|
|||||||
|
|
||||||
constructor(config?: LayerConfig) {
|
constructor(config?: LayerConfig) {
|
||||||
super(config);
|
super(config);
|
||||||
this.on('visibleChange', this._checkVisibility);
|
this.on('visibleChange.konva', this._checkVisibility);
|
||||||
this._checkVisibility();
|
this._checkVisibility();
|
||||||
|
|
||||||
this.on('imageSmoothingEnabledChange', this._setSmoothEnabled);
|
this.on('imageSmoothingEnabledChange.konva', this._setSmoothEnabled);
|
||||||
this._setSmoothEnabled();
|
this._setSmoothEnabled();
|
||||||
}
|
}
|
||||||
// for nodejs?
|
// for nodejs?
|
||||||
|
11
src/Node.ts
11
src/Node.ts
@ -2461,8 +2461,17 @@ export abstract class Node<Config extends NodeConfig = NodeConfig> {
|
|||||||
* drag and drop mode
|
* drag and drop mode
|
||||||
*/
|
*/
|
||||||
var stage = this.getStage();
|
var stage = this.getStage();
|
||||||
if (stage && DD._dragElements.has(this._id)) {
|
if (!stage) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const dragElement = DD._dragElements.get(this._id);
|
||||||
|
const isDragging = dragElement && dragElement.dragStatus === 'dragging';
|
||||||
|
const isReady = dragElement && dragElement.dragStatus === 'ready';
|
||||||
|
|
||||||
|
if (isDragging) {
|
||||||
this.stopDrag();
|
this.stopDrag();
|
||||||
|
} else if (isReady) {
|
||||||
|
DD._dragElements.delete(this._id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1126,4 +1126,46 @@ suite('DragAndDrop', function () {
|
|||||||
assert.equal(circle.x(), 70);
|
assert.equal(circle.x(), 70);
|
||||||
assert.equal(circle.y(), 70);
|
assert.equal(circle.y(), 70);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('disable drag on click', function () {
|
||||||
|
var stage = addStage();
|
||||||
|
stage.draggable(true);
|
||||||
|
var layer = new Konva.Layer();
|
||||||
|
stage.add(layer);
|
||||||
|
|
||||||
|
var circle = new Konva.Circle({
|
||||||
|
x: 70,
|
||||||
|
y: 70,
|
||||||
|
radius: 70,
|
||||||
|
fill: 'green',
|
||||||
|
stroke: 'black',
|
||||||
|
strokeWidth: 4,
|
||||||
|
name: 'myCircle',
|
||||||
|
draggable: true,
|
||||||
|
});
|
||||||
|
layer.add(circle);
|
||||||
|
layer.draw();
|
||||||
|
|
||||||
|
circle.on('click', function () {
|
||||||
|
circle.draggable(false);
|
||||||
|
circle.draggable(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
var dragstart = 0;
|
||||||
|
var dragend = 0;
|
||||||
|
|
||||||
|
stage.on('dragstart', function (e) {
|
||||||
|
dragstart += 1;
|
||||||
|
});
|
||||||
|
stage.on('dragend', function (e) {
|
||||||
|
dragend += 1;
|
||||||
|
});
|
||||||
|
|
||||||
|
stage.simulateMouseDown({ x: 70, y: 75 });
|
||||||
|
stage.simulateMouseUp({ x: 70, y: 70 });
|
||||||
|
|
||||||
|
// drag events should not be called
|
||||||
|
assert.equal(dragstart, 0);
|
||||||
|
assert.equal(dragend, 0);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user