mirror of
https://github.com/konvajs/konva.git
synced 2025-08-20 04:51:04 +08:00
Merge branch 'konvajs:master' into fix/corner-radius-negative-dimensions
This commit is contained in:
commit
33e5ddf4ae
@ -3,12 +3,18 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## 9.3.21 (not released)
|
||||
## 9.3.22 (2025-07-08)
|
||||
|
||||
- Fixed possible crash on `node.to()` method
|
||||
|
||||
## 9.3.21 (2025-07-07)
|
||||
|
||||
- Fixed memory leaks on Tween destroy
|
||||
- Fixed incorrect export of stage/layer when internal nodes used buffer canvas for rendering
|
||||
- Fixed incorrect render of cached node when buffer canvas is used
|
||||
- Fixed incorrect path lenth calculations
|
||||
- Fixed `pointerleave` bubbling
|
||||
- Added `pointerleave` event in `Stage`
|
||||
|
||||
## 9.3.20 (2025-03-20)
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "konva",
|
||||
"version": "9.3.20",
|
||||
"version": "9.3.22",
|
||||
"description": "HTML5 2d canvas library.",
|
||||
"author": "Anton Lavrenov",
|
||||
"files": [
|
||||
|
@ -58,6 +58,7 @@ const STAGE = 'Stage',
|
||||
[POINTERMOVE, '_pointermove'],
|
||||
[POINTERUP, '_pointerup'],
|
||||
[POINTERCANCEL, '_pointercancel'],
|
||||
[POINTERLEAVE, '_pointerleave'],
|
||||
[LOSTPOINTERCAPTURE, '_lostpointercapture'],
|
||||
];
|
||||
|
||||
|
12
src/Tween.ts
12
src/Tween.ts
@ -530,11 +530,13 @@ export class Tween {
|
||||
delete Tween.attrs[nodeId][thisId];
|
||||
|
||||
// Clean up parent objects if empty
|
||||
if (Object.keys(Tween.tweens[nodeId]).length === 0) {
|
||||
delete Tween.tweens[nodeId];
|
||||
}
|
||||
if (Object.keys(Tween.attrs[nodeId]).length === 0) {
|
||||
delete Tween.attrs[nodeId];
|
||||
if (Tween.tweens[nodeId]) {
|
||||
if (Object.keys(Tween.tweens[nodeId]).length === 0) {
|
||||
delete Tween.tweens[nodeId];
|
||||
}
|
||||
if (Object.keys(Tween.attrs[nodeId]).length === 0) {
|
||||
delete Tween.attrs[nodeId];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1223,6 +1223,19 @@ describe('Stage', function () {
|
||||
assert.equal(count, 2);
|
||||
});
|
||||
|
||||
it('stage pointerleave should fire when leaving stage', function () {
|
||||
var stage = addStage();
|
||||
|
||||
var stageLeave = 0;
|
||||
stage.on('pointerleave', function () {
|
||||
stageLeave += 1;
|
||||
});
|
||||
|
||||
stage.fire('pointerleave', undefined, false);
|
||||
|
||||
assert.equal(stageLeave, 1, 'stage pointerleave should fire');
|
||||
});
|
||||
|
||||
it('stage pointerleave should not fire when leaving a child', function () {
|
||||
var stage = addStage();
|
||||
var layer = new Konva.Layer();
|
||||
|
@ -257,6 +257,34 @@ describe('Tween', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('to method double simple usage', function (done) {
|
||||
var stage = addStage();
|
||||
|
||||
let finishCount = 0;
|
||||
const onFinish = () => {
|
||||
if (finishCount === 2) {
|
||||
done();
|
||||
}
|
||||
};
|
||||
stage.to({
|
||||
x: 10,
|
||||
duration: 0.001,
|
||||
onFinish: () => {
|
||||
assert(stage.x() === 10);
|
||||
finishCount += 1;
|
||||
onFinish();
|
||||
},
|
||||
});
|
||||
stage.to({
|
||||
y: 10,
|
||||
duration: 0.001,
|
||||
onFinish: () => {
|
||||
finishCount += 1;
|
||||
onFinish();
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it('tween to call update callback', function (done) {
|
||||
var stage = addStage();
|
||||
var updateCount = 0;
|
||||
@ -303,6 +331,8 @@ describe('Tween', function () {
|
||||
|
||||
line.to({
|
||||
points: [100, 100, 200, 100, 200, 200, 100, 200],
|
||||
// add another attribute for better test of cleanup
|
||||
x: 10,
|
||||
duration: 0.1,
|
||||
onFinish: function () {
|
||||
assert.deepEqual(
|
||||
|
Loading…
Reference in New Issue
Block a user