changed label rect drawing from Polygon to Shape to support rounded corners soon. Also wrapped the text and rect inside of an inner group so that the label can be positioned based on the pointer tip

This commit is contained in:
Eric Rowell
2013-03-17 17:20:06 -07:00
parent bb57810c9a
commit a1f934d26a
2 changed files with 123 additions and 94 deletions

View File

@@ -8,29 +8,30 @@ Test.Modules.LABEL = {
var layer = new Kinetic.Layer();
var label = new Kinetic.Plugins.Label({
x: 20,
y: 20,
x: 100,
y: 100,
draggable: true,
arrow: 'left',
arrowWidth: 20,
arrowHeight: 20,
text: {
text: {
text: 'Hello World!',
fontSize: 50,
fontFamily: 'Calibri',
fontStyle: 'normal',
lineHeight: 1.2,
padding: 10,
fill: 'green',
},
fill: 'green'
},
rect: {
fill: '#bbb',
stroke: '#333',
shadowColor: 'black',
shadowBlur: 1,
shadowBlur: 10,
shadowOffset: [10, 10],
shadowOpacity: 0.2,
lineJoin: 'round'
lineJoin: 'round',
pointerDirection: 'down',
pointerWidth: 20,
pointerHeight: 20,
cornerRadius: 5
}
});