mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
fix transformer validation
This commit is contained in:
parent
a2fef6624a
commit
da023deb78
8
konva.js
8
konva.js
@ -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
4
konva.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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 +
|
||||
|
@ -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());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user