setup support for pattern fills

This commit is contained in:
Eric Rowell
2012-05-12 18:18:06 -07:00
parent 92919058b2
commit 9e3475f37a
4 changed files with 93 additions and 46 deletions

View File

@@ -75,6 +75,39 @@ Test.prototype.tests = {
layer.add(group);
stage.add(layer);
},
'STAGE - add shape with pattern fill': function(containerId) {
var imageObj = new Image();
imageObj.onload = function() {
var stage = new Kinetic.Stage({
container: containerId,
width: 578,
height: 200
});
var layer = new Kinetic.Layer();
var group = new Kinetic.Group();
var circle = new Kinetic.Circle({
x: stage.getWidth() / 2,
y: stage.getHeight() / 2,
radius: 70,
fill: {
image: imageObj,
repeat: 'repeat',
offset: [20, 20]
},
stroke: 'black',
strokeWidth: 4,
name: 'myCircle',
draggable: true
});
group.add(circle);
layer.add(group);
stage.add(layer);
};
imageObj.src = '../darth-vader.jpg';
},
'STAGE - add shape with radial gradient fill': function(containerId) {
var stage = new Kinetic.Stage({