mirror of
https://github.com/konvajs/konva.git
synced 2026-02-25 21:52:43 +08:00
added fix for IE9
This commit is contained in:
4
dist/kinetic-core.js
vendored
4
dist/kinetic-core.js
vendored
@@ -3,7 +3,7 @@
|
|||||||
* http://www.kineticjs.com/
|
* http://www.kineticjs.com/
|
||||||
* Copyright 2012, Eric Rowell
|
* Copyright 2012, Eric Rowell
|
||||||
* Licensed under the MIT or GPL Version 2 licenses.
|
* Licensed under the MIT or GPL Version 2 licenses.
|
||||||
* Date: Mar 10 2012
|
* Date: Mar 11 2012
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 - 2012 by Eric Rowell
|
* Copyright (C) 2011 - 2012 by Eric Rowell
|
||||||
*
|
*
|
||||||
@@ -730,7 +730,7 @@ Kinetic.Container.prototype = {
|
|||||||
* and then readd all the layers
|
* and then readd all the layers
|
||||||
*/
|
*/
|
||||||
if(this.className === "Stage") {
|
if(this.className === "Stage") {
|
||||||
var canvases = this.container.childNodes;
|
var canvases = this.container.children;
|
||||||
var bufferCanvas = canvases[0];
|
var bufferCanvas = canvases[0];
|
||||||
var backstageCanvas = canvases[1];
|
var backstageCanvas = canvases[1];
|
||||||
|
|
||||||
|
|||||||
4
dist/kinetic-core.min.js
vendored
4
dist/kinetic-core.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -85,7 +85,7 @@ Kinetic.Container.prototype = {
|
|||||||
* and then readd all the layers
|
* and then readd all the layers
|
||||||
*/
|
*/
|
||||||
if(this.className === "Stage") {
|
if(this.className === "Stage") {
|
||||||
var canvases = this.container.childNodes;
|
var canvases = this.container.children;
|
||||||
var bufferCanvas = canvases[0];
|
var bufferCanvas = canvases[0];
|
||||||
var backstageCanvas = canvases[1];
|
var backstageCanvas = canvases[1];
|
||||||
|
|
||||||
|
|||||||
@@ -95,6 +95,34 @@ function Test() {
|
|||||||
|
|
||||||
stage.draw();
|
stage.draw();
|
||||||
},
|
},
|
||||||
|
"STAGE - remove layer with shape": function(containerId) {
|
||||||
|
var stage = new Kinetic.Stage(containerId, 578, 200);
|
||||||
|
var layer = new Kinetic.Layer();
|
||||||
|
var circle = new Kinetic.Circle({
|
||||||
|
x: stage.width / 2,
|
||||||
|
y: stage.height / 2,
|
||||||
|
radius: 70,
|
||||||
|
fill: "green",
|
||||||
|
stroke: "black",
|
||||||
|
strokeWidth: 4,
|
||||||
|
name: "myCircle"
|
||||||
|
});
|
||||||
|
|
||||||
|
layer.add(circle);
|
||||||
|
stage.add(layer);
|
||||||
|
|
||||||
|
test(stage.children.length === 1, "stage should have 1 children");
|
||||||
|
|
||||||
|
stage.remove(layer);
|
||||||
|
|
||||||
|
test(stage.children.length === 0, "stage should have 0 children");
|
||||||
|
},
|
||||||
|
"STAGE - remove layer with no shapes": function(containerId) {
|
||||||
|
var stage = new Kinetic.Stage(containerId, 578, 200);
|
||||||
|
var layer = new Kinetic.Layer();
|
||||||
|
stage.add(layer);
|
||||||
|
stage.remove(layer);
|
||||||
|
},
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
// LAYERS tests
|
// LAYERS tests
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
@@ -135,28 +163,6 @@ function Test() {
|
|||||||
|
|
||||||
test(layer.children.length === 0, "layer should have 0 children");
|
test(layer.children.length === 0, "layer should have 0 children");
|
||||||
},
|
},
|
||||||
"LAYERS - remove layer": function(containerId) {
|
|
||||||
var stage = new Kinetic.Stage(containerId, 578, 200);
|
|
||||||
var layer = new Kinetic.Layer();
|
|
||||||
var circle = new Kinetic.Circle({
|
|
||||||
x: stage.width / 2,
|
|
||||||
y: stage.height / 2,
|
|
||||||
radius: 70,
|
|
||||||
fill: "green",
|
|
||||||
stroke: "black",
|
|
||||||
strokeWidth: 4,
|
|
||||||
name: "myCircle"
|
|
||||||
});
|
|
||||||
|
|
||||||
layer.add(circle);
|
|
||||||
stage.add(layer);
|
|
||||||
|
|
||||||
test(stage.children.length === 1, "stage should have 1 children");
|
|
||||||
|
|
||||||
stage.remove(layer);
|
|
||||||
|
|
||||||
test(stage.children.length === 0, "stage should have 0 children");
|
|
||||||
},
|
|
||||||
"LAYERS - hide layer": function(containerId) {
|
"LAYERS - hide layer": function(containerId) {
|
||||||
var stage = new Kinetic.Stage(containerId, 578, 200);
|
var stage = new Kinetic.Stage(containerId, 578, 200);
|
||||||
var layer = new Kinetic.Layer();
|
var layer = new Kinetic.Layer();
|
||||||
|
|||||||
Reference in New Issue
Block a user