From cf58e9f7310838d613200c22977a370850f10de3 Mon Sep 17 00:00:00 2001 From: Mark Crossley Date: Sat, 12 Aug 2017 15:12:54 +0100 Subject: [PATCH] SpecularLighting param error SpecularLighting uses a parameter "diffuseConstant" both in the readme and the src code. It should be "specularConstant" according to W3C (and InkScape). --- README.md | 4 ++-- src/svg.filter.js | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index eec5f25..d50eacc 100644 --- a/README.md +++ b/README.md @@ -590,9 +590,9 @@ new SVG.OffsetEffect(x, y); [W3 doc](https://www.w3.org/TR/SVG/filters.html#feSpecularLightingElement) ```javascript -filter.specularLighting(surfaceScale, diffuseConstant, specularExponent, kernelUnitLength); +filter.specularLighting(surfaceScale, specularConstant, specularExponent, kernelUnitLength); //or -new SVG.SpecularLightingEffect(surfaceScale, diffuseConstant, specularExponent, kernelUnitLength); +new SVG.SpecularLightingEffect(surfaceScale, specularConstant, specularExponent, kernelUnitLength); ``` ***very complicated, just check out the W3 doc*** diff --git a/src/svg.filter.js b/src/svg.filter.js index aafa0cd..fe8aaf1 100644 --- a/src/svg.filter.js +++ b/src/svg.filter.js @@ -83,8 +83,8 @@ return this.put(new SVG.DisplacementMapEffect(in1,in2,scale,xChannelSelector,yChannelSelector)) }, // SpecularLighting effect - specularLighting: function(surfaceScale,diffuseConstant,specularExponent,kernelUnitLength){ - return this.put(new SVG.SpecularLightingEffect(surfaceScale,diffuseConstant,specularExponent,kernelUnitLength)) + specularLighting: function(surfaceScale,specularConstant,specularExponent,kernelUnitLength){ + return this.put(new SVG.SpecularLightingEffect(surfaceScale,specularConstant,specularExponent,kernelUnitLength)) }, // Tile effect tile: function(){ @@ -248,8 +248,8 @@ return this.parent() && this.parent().displacementMap(this,in2,scale,xChannelSelector,yChannelSelector) //pass this as the first input }, // SpecularLighting effect - specularLighting: function(surfaceScale,diffuseConstant,specularExponent,kernelUnitLength){ - return this.parent() && this.parent().specularLighting(surfaceScale,diffuseConstant,specularExponent,kernelUnitLength).in(this) + specularLighting: function(surfaceScale,specularConstant,specularExponent,kernelUnitLength){ + return this.parent() && this.parent().specularLighting(surfaceScale,specularConstant,specularExponent,kernelUnitLength).in(this) }, // Tile effect tile: function(){ @@ -426,10 +426,10 @@ kernelUnitLength: kernelUnitLength }) }, - specularLighting: function(surfaceScale,diffuseConstant,specularExponent,kernelUnitLength){ + specularLighting: function(surfaceScale,specularConstant,specularExponent,kernelUnitLength){ this.attr({ surfaceScale: surfaceScale, - diffuseConstant: diffuseConstant, + specularConstant: specularConstant, specularExponent: specularExponent, kernelUnitLength: kernelUnitLength })