Fix for #481
parent
2e040ced8b
commit
4c93894571
File diff suppressed because one or more lines are too long
|
@ -7840,13 +7840,13 @@ Snap.plugin(function (Snap, Element, Paper, glob) {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
|
// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
|
||||||
//
|
//
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
// you may not use this file except in compliance with the License.
|
// you may not use this file except in compliance with the License.
|
||||||
// You may obtain a copy of the License at
|
// You may obtain a copy of the License at
|
||||||
//
|
//
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
//
|
//
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -7892,7 +7892,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) {
|
||||||
paper.defs.appendChild(filter);
|
paper.defs.appendChild(filter);
|
||||||
return new Element(filter);
|
return new Element(filter);
|
||||||
};
|
};
|
||||||
|
|
||||||
eve.on("snap.util.getattr.filter", function () {
|
eve.on("snap.util.getattr.filter", function () {
|
||||||
eve.stop();
|
eve.stop();
|
||||||
var p = $(this.node, "filter");
|
var p = $(this.node, "filter");
|
||||||
|
@ -7967,22 +7967,23 @@ Snap.plugin(function (Snap, Element, Paper, glob) {
|
||||||
- opacity (number) #optional `0..1` opacity of the shadow
|
- opacity (number) #optional `0..1` opacity of the shadow
|
||||||
= (string) filter representation
|
= (string) filter representation
|
||||||
> Usage
|
> Usage
|
||||||
| var f = paper.filter(Snap.filter.shadow(0, 2, 3)),
|
| var f = paper.filter(Snap.filter.shadow(0, 2, .3)),
|
||||||
| c = paper.circle(10, 10, 10).attr({
|
| c = paper.circle(10, 10, 10).attr({
|
||||||
| filter: f
|
| filter: f
|
||||||
| });
|
| });
|
||||||
\*/
|
\*/
|
||||||
Snap.filter.shadow = function (dx, dy, blur, color, opacity) {
|
Snap.filter.shadow = function (dx, dy, blur, color, opacity) {
|
||||||
if (typeof blur == "string") {
|
if (opacity == null) {
|
||||||
color = blur;
|
if (color == null) {
|
||||||
opacity = color;
|
opacity = blur;
|
||||||
blur = 4;
|
blur = 4;
|
||||||
|
color = "#000";
|
||||||
|
} else {
|
||||||
|
color = blur;
|
||||||
|
opacity = color;
|
||||||
|
blur = 4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (typeof color != "string") {
|
|
||||||
opacity = color;
|
|
||||||
color = "#000";
|
|
||||||
}
|
|
||||||
color = color || "#000";
|
|
||||||
if (blur == null) {
|
if (blur == null) {
|
||||||
blur = 4;
|
blur = 4;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10781,7 +10781,7 @@ the class’s presence or the value of the <code>flag</code> argument.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">var f = paper.filter(Snap.filter.shadow(0, 2, 3)),
|
<section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">var f = paper.filter(Snap.filter.shadow(0, 2, .3)),
|
||||||
c = paper.circle(10, 10, 10).attr({
|
c = paper.circle(10, 10, 10).attr({
|
||||||
filter: f
|
filter: f
|
||||||
});</code></pre></section>
|
});</code></pre></section>
|
||||||
|
@ -10796,7 +10796,7 @@ the class’s presence or the value of the <code>flag</code> argument.
|
||||||
|
|
||||||
<article id="Snap.filter.grayscale">
|
<article id="Snap.filter.grayscale">
|
||||||
<header>
|
<header>
|
||||||
<h3 class="dr-method">Snap.filter.grayscale(amount)<a href="#Snap.filter.grayscale" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 179 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L179">➭</a></h3>
|
<h3 class="dr-method">Snap.filter.grayscale(amount)<a href="#Snap.filter.grayscale" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 180 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L180">➭</a></h3>
|
||||||
</header>
|
</header>
|
||||||
<section>
|
<section>
|
||||||
<div class="extra" id="Snap.filter.grayscale-extra"></div>
|
<div class="extra" id="Snap.filter.grayscale-extra"></div>
|
||||||
|
@ -10856,7 +10856,7 @@ the class’s presence or the value of the <code>flag</code> argument.
|
||||||
|
|
||||||
<article id="Snap.filter.sepia">
|
<article id="Snap.filter.sepia">
|
||||||
<header>
|
<header>
|
||||||
<h3 class="dr-method">Snap.filter.sepia(amount)<a href="#Snap.filter.sepia" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 206 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L206">➭</a></h3>
|
<h3 class="dr-method">Snap.filter.sepia(amount)<a href="#Snap.filter.sepia" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 207 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L207">➭</a></h3>
|
||||||
</header>
|
</header>
|
||||||
<section>
|
<section>
|
||||||
<div class="extra" id="Snap.filter.sepia-extra"></div>
|
<div class="extra" id="Snap.filter.sepia-extra"></div>
|
||||||
|
@ -10916,7 +10916,7 @@ the class’s presence or the value of the <code>flag</code> argument.
|
||||||
|
|
||||||
<article id="Snap.filter.saturate">
|
<article id="Snap.filter.saturate">
|
||||||
<header>
|
<header>
|
||||||
<h3 class="dr-method">Snap.filter.saturate(amount)<a href="#Snap.filter.saturate" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 234 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L234">➭</a></h3>
|
<h3 class="dr-method">Snap.filter.saturate(amount)<a href="#Snap.filter.saturate" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 235 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L235">➭</a></h3>
|
||||||
</header>
|
</header>
|
||||||
<section>
|
<section>
|
||||||
<div class="extra" id="Snap.filter.saturate-extra"></div>
|
<div class="extra" id="Snap.filter.saturate-extra"></div>
|
||||||
|
@ -10976,7 +10976,7 @@ the class’s presence or the value of the <code>flag</code> argument.
|
||||||
|
|
||||||
<article id="Snap.filter.hueRotate">
|
<article id="Snap.filter.hueRotate">
|
||||||
<header>
|
<header>
|
||||||
<h3 class="dr-method">Snap.filter.hueRotate(angle)<a href="#Snap.filter.hueRotate" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 254 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L254">➭</a></h3>
|
<h3 class="dr-method">Snap.filter.hueRotate(angle)<a href="#Snap.filter.hueRotate" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 255 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L255">➭</a></h3>
|
||||||
</header>
|
</header>
|
||||||
<section>
|
<section>
|
||||||
<div class="extra" id="Snap.filter.hueRotate-extra"></div>
|
<div class="extra" id="Snap.filter.hueRotate-extra"></div>
|
||||||
|
@ -11036,7 +11036,7 @@ the class’s presence or the value of the <code>flag</code> argument.
|
||||||
|
|
||||||
<article id="Snap.filter.invert">
|
<article id="Snap.filter.invert">
|
||||||
<header>
|
<header>
|
||||||
<h3 class="dr-method">Snap.filter.invert(amount)<a href="#Snap.filter.invert" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 272 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L272">➭</a></h3>
|
<h3 class="dr-method">Snap.filter.invert(amount)<a href="#Snap.filter.invert" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 273 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L273">➭</a></h3>
|
||||||
</header>
|
</header>
|
||||||
<section>
|
<section>
|
||||||
<div class="extra" id="Snap.filter.invert-extra"></div>
|
<div class="extra" id="Snap.filter.invert-extra"></div>
|
||||||
|
@ -11096,7 +11096,7 @@ the class’s presence or the value of the <code>flag</code> argument.
|
||||||
|
|
||||||
<article id="Snap.filter.brightness">
|
<article id="Snap.filter.brightness">
|
||||||
<header>
|
<header>
|
||||||
<h3 class="dr-method">Snap.filter.brightness(amount)<a href="#Snap.filter.brightness" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 294 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L294">➭</a></h3>
|
<h3 class="dr-method">Snap.filter.brightness(amount)<a href="#Snap.filter.brightness" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 295 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L295">➭</a></h3>
|
||||||
</header>
|
</header>
|
||||||
<section>
|
<section>
|
||||||
<div class="extra" id="Snap.filter.brightness-extra"></div>
|
<div class="extra" id="Snap.filter.brightness-extra"></div>
|
||||||
|
@ -11156,7 +11156,7 @@ the class’s presence or the value of the <code>flag</code> argument.
|
||||||
|
|
||||||
<article id="Snap.filter.contrast">
|
<article id="Snap.filter.contrast">
|
||||||
<header>
|
<header>
|
||||||
<h3 class="dr-method">Snap.filter.contrast(amount)<a href="#Snap.filter.contrast" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 314 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L314">➭</a></h3>
|
<h3 class="dr-method">Snap.filter.contrast(amount)<a href="#Snap.filter.contrast" title="Link to this section" class="dr-hash">⚓</a><a class="dr-sourceline" title="Go to line 315 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L315">➭</a></h3>
|
||||||
</header>
|
</header>
|
||||||
<section>
|
<section>
|
||||||
<div class="extra" id="Snap.filter.contrast-extra"></div>
|
<div class="extra" id="Snap.filter.contrast-extra"></div>
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
|
// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
|
||||||
//
|
//
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
// you may not use this file except in compliance with the License.
|
// you may not use this file except in compliance with the License.
|
||||||
// You may obtain a copy of the License at
|
// You may obtain a copy of the License at
|
||||||
//
|
//
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
//
|
//
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -51,7 +51,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) {
|
||||||
paper.defs.appendChild(filter);
|
paper.defs.appendChild(filter);
|
||||||
return new Element(filter);
|
return new Element(filter);
|
||||||
};
|
};
|
||||||
|
|
||||||
eve.on("snap.util.getattr.filter", function () {
|
eve.on("snap.util.getattr.filter", function () {
|
||||||
eve.stop();
|
eve.stop();
|
||||||
var p = $(this.node, "filter");
|
var p = $(this.node, "filter");
|
||||||
|
@ -126,22 +126,23 @@ Snap.plugin(function (Snap, Element, Paper, glob) {
|
||||||
- opacity (number) #optional `0..1` opacity of the shadow
|
- opacity (number) #optional `0..1` opacity of the shadow
|
||||||
= (string) filter representation
|
= (string) filter representation
|
||||||
> Usage
|
> Usage
|
||||||
| var f = paper.filter(Snap.filter.shadow(0, 2, 3)),
|
| var f = paper.filter(Snap.filter.shadow(0, 2, .3)),
|
||||||
| c = paper.circle(10, 10, 10).attr({
|
| c = paper.circle(10, 10, 10).attr({
|
||||||
| filter: f
|
| filter: f
|
||||||
| });
|
| });
|
||||||
\*/
|
\*/
|
||||||
Snap.filter.shadow = function (dx, dy, blur, color, opacity) {
|
Snap.filter.shadow = function (dx, dy, blur, color, opacity) {
|
||||||
if (typeof blur == "string") {
|
if (opacity == null) {
|
||||||
color = blur;
|
if (color == null) {
|
||||||
opacity = color;
|
opacity = blur;
|
||||||
blur = 4;
|
blur = 4;
|
||||||
|
color = "#000";
|
||||||
|
} else {
|
||||||
|
color = blur;
|
||||||
|
opacity = color;
|
||||||
|
blur = 4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (typeof color != "string") {
|
|
||||||
opacity = color;
|
|
||||||
color = "#000";
|
|
||||||
}
|
|
||||||
color = color || "#000";
|
|
||||||
if (blur == null) {
|
if (blur == null) {
|
||||||
blur = 4;
|
blur = 4;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue