Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dropShadow updates #64

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/svg.filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const updateFunctions = {
// DisplacementMap effect
displacementMap: getAttrSetter(['in', 'in2', 'scale', 'xChannelSelector', 'yChannelSelector']),
// DropShadow effect
dropShadow: getAttrSetter(['in', 'dx', 'dy', 'stdDeviation']),
dropShadow: getAttrSetter(['in', 'dx', 'dy', 'stdDeviation', 'flood-color', 'flood-opacity']),
// Flood effect
flood: getAttrSetter(['flood-color', 'flood-opacity']),
// Gaussian Blur effect
Expand Down Expand Up @@ -378,9 +378,9 @@ const chainingEffects = {
displacementMap: function (in2, scale, xChannelSelector, yChannelSelector) {
return this.parent() && this.parent().displacementMap(this, in2, scale, xChannelSelector, yChannelSelector) // pass this as the first input
},
// DisplacementMap effect
dropShadow: function (x, y, stdDeviation) {
return this.parent() && this.parent().dropShadow(this, x, y, stdDeviation).in(this) // pass this as the first input
// DropShadow effect
dropShadow: function (x, y, stdDeviation, color, opacity) {
return this.parent() && this.parent().dropShadow(this, x, y, stdDeviation, color, opacity).in(this) // pass this as the first input
},
// Flood effect
flood: function (color, opacity) {
Expand Down
6 changes: 4 additions & 2 deletions svg.filter.js.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ declare module "@svgdotjs/svg.js" {
convolveMatrix (matrix: Array<number> | string): ConvolveMatrixEffect
diffuseLighting (surfaceScale: number, lightingColor: string, diffuseConstant: number, kernelUnitLength: number): DiffuseLightingEffect
displacementMap (in1: EffectOrString, in2: EffectOrString, scale: number, xChannelSelector: string, yChannelSelector: string): DisplacementMapEffect
dropShadow (in1: EffectOrString, dx: number, dy: number, stdDeviation: number): DropShadowEffect
dropShadow (in1: EffectOrString, dx: number, dy: number, stdDeviation: number, color: string, opacity: number): DropShadowEffect
flood (color: string, opacity: number): FloodEffect
gaussianBlur (x: number, y: number): GaussianBlurEffect
image (src: string): ImageEffect
Expand All @@ -50,6 +50,8 @@ declare module "@svgdotjs/svg.js" {
readonly dy: SVGAnimatedNumber;
readonly stdDeviationX: SVGAnimatedNumber;
readonly stdDeviationY: SVGAnimatedNumber;
readonly color: SVGAnimatedString;
readonly opacity: SVGAnimatedNumber;
setStdDeviation(stdDeviationX: number, stdDeviationY: number): void;
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEDisplacementMapElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
Expand Down Expand Up @@ -93,7 +95,7 @@ declare module "@svgdotjs/svg.js" {
convolveMatrix (matrix: Array<number> | string): ConvolveMatrixEffect
diffuseLighting (surfaceScale: number, lightingColor: string, diffuseConstant: number, kernelUnitLength: number): DiffuseLightingEffect
displacementMap (in2: EffectOrString, scale: number, xChannelSelector: string, yChannelSelector: string): DisplacementMapEffect
dropShadow (dx: number, dy: number, stdDeviation: number): DropShadowEffect
dropShadow (dx: number, dy: number, stdDeviation: number, color: string, opacity: number): DropShadowEffect
flood (color: string, opacity: number): FloodEffect
gaussianBlur (x: number, y: number): GaussianBlurEffect
image (src: string): ImageEffect
Expand Down