diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index cc221f5..3611c9b 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -196,6 +196,12 @@ var finalWidth = 0; var finalHeight = 0; + var compositeOperation = renderer.blendModes[this.blendMode]; + if (compositeOperation !== context.globalCompositeOperation) + { + context.globalCompositeOperation = compositeOperation; + } + context.globalAlpha = this.worldAlpha; this.displayObjectUpdateTransform(); diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index cc221f5..3611c9b 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -196,6 +196,12 @@ var finalWidth = 0; var finalHeight = 0; + var compositeOperation = renderer.blendModes[this.blendMode]; + if (compositeOperation !== context.globalCompositeOperation) + { + context.globalCompositeOperation = compositeOperation; + } + context.globalAlpha = this.worldAlpha; this.displayObjectUpdateTransform(); diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 425a22c..d48d0ae 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -31,6 +31,7 @@ * @param [style.dropShadowColor='#000000'] {string} A fill style to be used on the dropshadow e.g 'red', '#00FF00' * @param [style.dropShadowAngle=Math.PI/4] {number} Set a angle of the drop shadow * @param [style.dropShadowDistance=5] {number} Set a distance of the drop shadow + * @param [style.dropShadowBlur=0] {number} Set a shadow blur radius * @param [style.padding=0] {number} Occasionally some fonts are cropped on top or bottom. Adding some padding will * prevent this from happening by adding padding to the top and bottom of text height. * @param [style.textBaseline='alphabetic'] {string} The baseline of the text that is rendered. @@ -156,6 +157,7 @@ * @param [style.dropShadowColor='#000000'] {string|number} A fill style to be used on the dropshadow e.g 'red', '#00FF00' * @param [style.dropShadowAngle=Math.PI/6] {number} Set a angle of the drop shadow * @param [style.dropShadowDistance=5] {number} Set a distance of the drop shadow + * @param [style.dropShadowBlur=0] {number} Set a shadow blur radius * @param [style.padding=0] {number} Occasionally some fonts are cropped on top or bottom. Adding some padding will * prevent this from happening by adding padding to the top and bottom of text height. * @param [style.textBaseline='alphabetic'] {string} The baseline of the text that is rendered. @@ -196,8 +198,9 @@ style.dropShadow = style.dropShadow || false; style.dropShadowColor = style.dropShadowColor || '#000000'; - style.dropShadowAngle = style.dropShadowAngle || Math.PI / 6; - style.dropShadowDistance = style.dropShadowDistance || 5; + style.dropShadowAngle = style.dropShadowAngle !== undefined ? style.dropShadowAngle : Math.PI / 6; + style.dropShadowDistance = style.dropShadowDistance !== undefined ? style.dropShadowDistance : 5; + style.dropShadowBlur = style.dropShadowBlur !== undefined ? style.dropShadowBlur : 0; //shadowBlur is '0' by default according to HTML style.padding = style.padding || 0; @@ -304,7 +307,12 @@ if (style.dropShadow) { - this.context.fillStyle = style.dropShadowColor; + if (style.dropShadowBlur > 0) { + this.context.shadowColor = style.dropShadowColor; + this.context.shadowBlur = style.dropShadowBlur; + } else { + this.context.fillStyle = style.dropShadowColor; + } var xShadowOffset = Math.cos(style.dropShadowAngle) * style.dropShadowDistance; var yShadowOffset = Math.sin(style.dropShadowAngle) * style.dropShadowDistance;