first round of new Path shape. Despite multiple optimizations, the path performance isn't as good as a previous experiment done with v3.8.1. Will keep this as a separate branch until the performance issues are resolved

This commit is contained in:
Eric Rowell
2012-05-27 21:46:03 -07:00
parent 4488f22c32
commit cc35abd0f6
8 changed files with 484 additions and 3 deletions

View File

@@ -16,7 +16,7 @@ function log(message) {
* Test constructor
*/
function Test() {
this.testOnly = '';
this.testOnly = 'SHAPE - add path';
this.counter = 0;
testCounter = document.createElement('div');

View File

@@ -1169,6 +1169,44 @@ Test.prototype.tests = {
});
//stage.start();
},
'SHAPE - add path': function(containerId) {
var stage = new Kinetic.Stage({
container: containerId,
width: 1024,
height: 480
});
var layer = new Kinetic.Layer();
for(var key in worldMap) {
var c = worldMap[key];
// induce scope
( function() {
var path = new Kinetic.Path({
commands: c,
fill: '#ccc',
stroke: '#999',
strokeWidth: 1
});
path.on('mouseover', function() {
//console.log(1)
//path.setFill('red');
//layer.draw();
});
path.on('mouseout', function() {
//path.setFill('#ccc');
//layer.draw();
});
layer.add(path);
}());
stage.add(layer);
}
},
'SHAPE - add shape with custom attr pointing to self': function(containerId) {
var stage = new Kinetic.Stage({
container: containerId,