fix #164 prepend # to colorKey so that events work again in non webit browsers

This commit is contained in:
Eric Rowell 2012-11-27 19:43:33 -08:00
parent 393a9687dc
commit e6eb647462
2 changed files with 3 additions and 3 deletions

View File

@ -216,12 +216,12 @@ Kinetic.HitRenderer.prototype = {
_fill: function(shape) { _fill: function(shape) {
var context = this.context; var context = this.context;
context.save(); context.save();
context.fillStyle = shape.colorKey; context.fillStyle = '#' + shape.colorKey;
context.fill(context); context.fill(context);
context.restore(); context.restore();
}, },
_stroke: function(shape) { _stroke: function(shape) {
var context = this.context, stroke = shape.colorKey, strokeWidth = shape.getStrokeWidth(); var context = this.context, stroke = '#' + shape.colorKey, strokeWidth = shape.getStrokeWidth();
if(stroke || strokeWidth) { if(stroke || strokeWidth) {
context.save(); context.save();
context.lineWidth = strokeWidth || 2; context.lineWidth = strokeWidth || 2;

View File

@ -362,7 +362,7 @@ Test.Modules.MANUAL = {
layer.add(star); layer.add(star);
stage.add(layer); stage.add(layer);
//document.body.appendChild(layer.bufferCanvas.element) showHit(layer);
}, },
'EVENTS - drag events click': function(containerId) { 'EVENTS - drag events click': function(containerId) {
var stage = new Kinetic.Stage({ var stage = new Kinetic.Stage({