From cf32e72b850d2c13a75451b5a1f1a609ef2e8ada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B0=D0=B2=D1=80=D1=91=D0=BD=D0=BE=D0=B2=20=D0=90?= =?UTF-8?q?=D0=BD=D1=82=D0=BE=D0=BD?= Date: Fri, 15 Nov 2013 01:06:34 +0800 Subject: [PATCH] not this commit --- src/Node.js | 4 ++-- test/unit/Node-test.js | 33 --------------------------------- 2 files changed, 2 insertions(+), 35 deletions(-) diff --git a/src/Node.js b/src/Node.js index 1b7f9e1a..4b75b604 100644 --- a/src/Node.js +++ b/src/Node.js @@ -1009,8 +1009,8 @@ x = config.x || 0, y = config.y || 0, canvas = new Kinetic.SceneCanvas({ - width: this.getWidth() || config.width || (stage ? stage.getWidth() : 0), - height: this.getHeight() || config.height || (stage ? stage.getHeight() : 0), + width: config.width || stage.getWidth(), + height: config.height || stage.getHeight(), pixelRatio: 1 }), context = canvas.getContext(); diff --git a/test/unit/Node-test.js b/test/unit/Node-test.js index 5de474e8..c45cf2e9 100644 --- a/test/unit/Node-test.js +++ b/test/unit/Node-test.js @@ -950,39 +950,6 @@ suite('Node', function() { showHit(layer); }); - // ====================================================== - test('node caching width minimal configuration', function(done) { - var stage = addStage(); - var layer = new Kinetic.Layer(); - stage.add(layer); - - var rect = new Kinetic.Rect({ - width : 50, - height : 50, - fill: 'green', - stroke: 'blue', - strokeWidth: 5, - draggable: true - }); - - rect.toImage({ - callback: function(imageObj) { - assert.equal(Kinetic.Util._isElement(imageObj), true); - var cachedShape = new Kinetic.Image({ - image: imageObj, - draggable: true, - stroke: 'red', - strokeWidth: 5 - }); - - layer.add(cachedShape); - layer.draw(); - done(); - } - }); - - showHit(layer); - }); // ====================================================== test('hide group', function() { var stage = addStage();