fix transformer validation

This commit is contained in:
Anton Lavrenov 2018-02-18 11:45:24 +08:00
parent a2fef6624a
commit da023deb78
4 changed files with 16 additions and 8 deletions

View File

@ -2,7 +2,7 @@
* Konva JavaScript Framework v1.7.6
* http://konvajs.github.io/
* Licensed under the MIT
* Date: Sat Feb 10 2018
* Date: Sun Feb 18 2018
*
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
* Modified work Copyright (C) 2014 - present by Anton Lavrenov (Konva)
@ -18697,6 +18697,10 @@
// debugger;
var dx = pure.x * scaleX;
var dy = pure.y * scaleY;
// var dxo = node.offsetX() * scaleX;
// var dyo = node.offsetY() * scaleY;
this.getNode().setAttrs({
scaleX: scaleX,
scaleY: scaleY,
@ -18790,7 +18794,7 @@
}
if (val instanceof Array) {
val.forEach(function(name) {
if (RESIZERS_NAMES.indexOf('name') === -1) {
if (RESIZERS_NAMES.indexOf(name) === -1) {
Konva.Util.warn(
'Unknown resizer name: ' +
name +

4
konva.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -396,6 +396,10 @@
// debugger;
var dx = pure.x * scaleX;
var dy = pure.y * scaleY;
// var dxo = node.offsetX() * scaleX;
// var dyo = node.offsetY() * scaleY;
this.getNode().setAttrs({
scaleX: scaleX,
scaleY: scaleY,
@ -489,7 +493,7 @@
}
if (val instanceof Array) {
val.forEach(function(name) {
if (RESIZERS_NAMES.indexOf('name') === -1) {
if (RESIZERS_NAMES.indexOf(name) === -1) {
Konva.Util.warn(
'Unknown resizer name: ' +
name +

View File

@ -218,13 +218,13 @@ suite('Transformer', function() {
tr._fitNodeInto({
x: 50,
y: 50,
width: 120,
height: 120
width: 200,
height: 100
});
assert.equal(rect.x(), 100);
assert.equal(rect.y(), 100);
assert.equal(rect.width() * rect.scaleX(), 120);
assert.equal(rect.width() * rect.scaleX(), 200);
assert.equal(rect.height() * rect.scaleY(), 100);
assert.equal(rect.rotation(), rect.rotation());