mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-03-16 22:10:32 +00:00
Fix scaling issues that involves width/height (#4491)
* fixed * added a small test * typo
This commit is contained in:
parent
91de6d078d
commit
a9d2fb1ba5
2 changed files with 19 additions and 1 deletions
|
|
@ -453,7 +453,8 @@
|
|||
prefix = this.group.transformMatrixKey(skipGroup) + sep;
|
||||
};
|
||||
return prefix + this.top + sep + this.left + sep + this.scaleX + sep + this.scaleY +
|
||||
sep + this.skewX + sep + this.skewY + sep + this.angle + sep + this.flipX + sep + this.flipY;
|
||||
sep + this.skewX + sep + this.skewY + sep + this.angle + sep + this.flipX + sep + this.flipY +
|
||||
sep + this.width + sep + this.height;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -331,6 +331,23 @@
|
|||
assert.ok(cObj.isOnScreen(), 'zooming out the object is again on screen');
|
||||
});
|
||||
|
||||
QUnit.test('transformMatrixKey depends from properties', function(assert) {
|
||||
var cObj = new fabric.Object(
|
||||
{ left: -10, top: -10, width: 30, height: 40, strokeWidth: 0});
|
||||
var key1 = cObj.transformMatrixKey();
|
||||
cObj.left = 5;
|
||||
var key2 = cObj.transformMatrixKey();
|
||||
cObj.left = -10;
|
||||
var key3 = cObj.transformMatrixKey();
|
||||
cObj.width = 5;
|
||||
var key4 = cObj.transformMatrixKey();
|
||||
assert.notEqual(key1, key2, 'keys are different');
|
||||
assert.equal(key1, key3, 'keys are equal');
|
||||
assert.notEqual(key4, key2, 'keys are different');
|
||||
assert.notEqual(key4, key1, 'keys are different');
|
||||
assert.notEqual(key4, key3, 'keys are different');
|
||||
});
|
||||
|
||||
QUnit.test('isOnScreen with object that include canvas', function(assert) {
|
||||
var cObj = new fabric.Object(
|
||||
{ left: -10, top: -10, width: canvas.getWidth() + 100, height: canvas.getHeight(), strokeWidth: 0});
|
||||
|
|
|
|||
Loading…
Reference in a new issue