mirror of
https://github.com/konvajs/konva.git
synced 2025-10-27 04:09:02 +08:00
update CHANGELOG with new version
This commit is contained in:
@@ -5,6 +5,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
## [new version][unreleased]
|
## [new version][unreleased]
|
||||||
|
|
||||||
|
## [2.0.1][2018-03-15]
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
* Several bugs fixes for `Konva.Transformer`
|
||||||
|
|
||||||
## [2.0.0][2018-03-15]
|
## [2.0.0][2018-03-15]
|
||||||
|
|
||||||
|
|||||||
5
konva.js
5
konva.js
@@ -18670,6 +18670,7 @@
|
|||||||
this.detach();
|
this.detach();
|
||||||
}
|
}
|
||||||
this._node = node;
|
this._node = node;
|
||||||
|
this._clearCache(NODE_RECT);
|
||||||
|
|
||||||
node.on(
|
node.on(
|
||||||
TRANSFORM_CHANGE_STR,
|
TRANSFORM_CHANGE_STR,
|
||||||
@@ -18691,7 +18692,9 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
detach: function() {
|
detach: function() {
|
||||||
|
if (this.getNode()) {
|
||||||
this.getNode().off('.resizer');
|
this.getNode().off('.resizer');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_getNodeRect: function() {
|
_getNodeRect: function() {
|
||||||
@@ -19150,7 +19153,7 @@
|
|||||||
},
|
},
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
Konva.Group.prototype.destroy.call(this);
|
Konva.Group.prototype.destroy.call(this);
|
||||||
this.getNode().off('.resizer');
|
this.detach();
|
||||||
this._removeEvents();
|
this._removeEvents();
|
||||||
},
|
},
|
||||||
// do not work as a container
|
// do not work as a container
|
||||||
|
|||||||
2
konva.min.js
vendored
2
konva.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -156,6 +156,7 @@
|
|||||||
this.detach();
|
this.detach();
|
||||||
}
|
}
|
||||||
this._node = node;
|
this._node = node;
|
||||||
|
this._clearCache(NODE_RECT);
|
||||||
|
|
||||||
node.on(
|
node.on(
|
||||||
TRANSFORM_CHANGE_STR,
|
TRANSFORM_CHANGE_STR,
|
||||||
@@ -177,7 +178,9 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
detach: function() {
|
detach: function() {
|
||||||
|
if (this.getNode()) {
|
||||||
this.getNode().off('.resizer');
|
this.getNode().off('.resizer');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_getNodeRect: function() {
|
_getNodeRect: function() {
|
||||||
@@ -636,7 +639,7 @@
|
|||||||
},
|
},
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
Konva.Group.prototype.destroy.call(this);
|
Konva.Group.prototype.destroy.call(this);
|
||||||
this.getNode().off('.resizer');
|
this.detach();
|
||||||
this._removeEvents();
|
this._removeEvents();
|
||||||
},
|
},
|
||||||
// do not work as a container
|
// do not work as a container
|
||||||
|
|||||||
@@ -642,4 +642,34 @@ suite('Transformer', function() {
|
|||||||
|
|
||||||
layer.draw();
|
layer.draw();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('reset attrs on node set', function() {
|
||||||
|
var stage = addStage();
|
||||||
|
var layer = new Konva.Layer();
|
||||||
|
stage.add(layer);
|
||||||
|
|
||||||
|
var rect = new Konva.Rect({
|
||||||
|
x: 100,
|
||||||
|
y: 60,
|
||||||
|
draggable: true,
|
||||||
|
width: 100,
|
||||||
|
height: 100,
|
||||||
|
fill: 'yellow'
|
||||||
|
});
|
||||||
|
layer.add(rect);
|
||||||
|
|
||||||
|
var tr = new Konva.Transformer();
|
||||||
|
layer.add(tr);
|
||||||
|
layer.draw();
|
||||||
|
|
||||||
|
assert.equal(tr.getWidth(), 0);
|
||||||
|
|
||||||
|
tr.attachTo(rect);
|
||||||
|
assert.equal(tr.getWidth(), 100);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('can destroy without attached node', function() {
|
||||||
|
var tr = new Konva.Transformer();
|
||||||
|
tr.destroy();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user