Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
raphael
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nhn
raphael
Commits
d79aba6b
Commit
d79aba6b
authored
Mar 04, 2010
by
Dmitry Baranovskiy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'cuttingedge' of git@github.com:DmitryBaranovskiy/raphael into cuttingedge
parents
c2ee52f0
aceaf334
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
20 deletions
+29
-20
raphael.shadow.js
plugins/raphael.shadow.js
+29
-20
No files found.
plugins/raphael.shadow.js
View file @
d79aba6b
/*!
* Raphael Shadow
Plugin 0.2
* Raphael Shadow
plugin 0.3
*
* Copyright (c) 2009 Dmitry Baranovskiy (http://raphaeljs.com)
* Copyright (c) 200
8 - 200
9 Dmitry Baranovskiy (http://raphaeljs.com)
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
*/
Raphael
.
shadow
=
function
(
x
,
y
,
w
,
h
,
options
)
{
// options format: {
// size: 0..1, shadow size
// color: "#000", placeholder colour
// stroke: "#000", placeholder stroke colour
// shadow: "#000", shadow colour
// target: "someID" | htmlElement
// r: 5, radius of placeholder rounded corners
// }
options
=
options
||
{};
...
...
@@ -19,25 +19,34 @@ Raphael.shadow = function (x, y, w, h, options) {
color
=
options
.
color
||
"#fff"
,
stroke
=
options
.
stroke
||
color
,
shadowColor
=
options
.
shadow
||
"#000"
,
R
=
options
.
r
||
3
,
target
=
options
.
target
||
null
,
R
=
options
.
r
==
null
?
3
:
options
.
r
,
s
=
size
,
b
=
size
*
2
,
r
=
b
+
s
,
rg
=
this
.
format
(
"r{0}-{0}"
,
shadowColor
),
rect
=
"rect"
,
circ
=
"circle"
,
none
=
"none"
;
var
res
=
this
([
x
-
s
,
y
-
t
,
w
+
(
x
=
s
)
*
2
,
h
+
(
y
=
t
)
+
b
,
{
type
:
rect
,
x
:
x
-
s
,
y
:
y
-
t
,
width
:
b
+
s
,
height
:
h
+
y
+
b
,
stroke
:
none
,
fill
:
this
.
format
(
"180-{0}-{0}"
,
shadowColor
),
opacity
:
0
,
"clip-rect"
:
[
x
-
s
+
1
,
y
-
t
+
r
,
b
,
h
+
y
+
b
-
r
*
2
+
.
9
]},
{
type
:
rect
,
x
:
x
+
w
-
b
,
y
:
y
-
t
,
width
:
b
+
s
,
height
:
h
+
y
+
b
,
stroke
:
none
,
fill
:
this
.
format
(
"0-{0}-{0}"
,
shadowColor
),
opacity
:
0
,
"clip-rect"
:
[
x
+
w
-
s
+
1
,
y
-
t
+
r
,
b
,
h
+
y
+
b
-
r
*
2
]},
{
type
:
rect
,
x
:
x
+
b
-
1
,
y
:
y
+
h
-
s
,
width
:
w
+
b
,
height
:
b
+
s
,
stroke
:
none
,
fill
:
this
.
format
(
"270-{0}-{0}"
,
shadowColor
),
opacity
:
0
,
"clip-rect"
:
[
x
+
b
,
y
+
h
-
s
,
w
+
b
-
r
*
2
,
b
+
s
]},
{
type
:
rect
,
x
:
x
+
s
-
1
,
y
:
y
-
t
,
width
:
w
+
b
,
height
:
b
+
s
,
stroke
:
none
,
fill
:
this
.
format
(
"90-{0}-{0}"
,
shadowColor
),
opacity
:
0
,
"clip-rect"
:
[
x
+
b
,
y
-
t
,
w
+
b
-
r
*
2
,
s
+
t
+
1
]},
{
type
:
circ
,
cx
:
x
+
b
,
cy
:
y
+
h
-
s
,
r
:
r
,
stroke
:
none
,
fill
:
rg
,
opacity
:
0
,
"clip-rect"
:
[
x
-
s
,
y
+
h
-
s
+
.
999
,
r
,
r
]},
{
type
:
circ
,
cx
:
x
+
w
-
b
,
cy
:
y
+
h
-
s
,
r
:
r
,
stroke
:
none
,
fill
:
rg
,
opacity
:
0
,
"clip-rect"
:
[
x
+
w
-
b
,
y
+
h
-
s
,
r
,
r
]},
{
type
:
circ
,
cx
:
x
+
b
,
cy
:
y
-
t
+
r
,
r
:
r
,
stroke
:
none
,
fill
:
rg
,
opacity
:
0
,
"clip-rect"
:
[
x
-
s
,
y
-
t
,
r
,
r
]},
{
type
:
circ
,
cx
:
x
+
w
-
b
,
cy
:
y
-
t
+
r
,
r
:
r
,
stroke
:
none
,
fill
:
rg
,
opacity
:
0
,
"clip-rect"
:
[
x
+
w
-
b
,
y
-
t
,
r
,
r
]},
{
type
:
rect
,
x
:
x
,
y
:
y
,
width
:
w
,
height
:
h
,
r
:
R
,
fill
:
color
,
stroke
:
stroke
}
]);
return
res
[
0
].
paper
;
};
\ No newline at end of file
none
=
"none"
,
res
,
set
;
if
(
target
)
{
res
=
this
(
target
,
w
+
(
x
=
s
)
*
2
,
h
+
(
y
=
t
)
+
b
);
}
else
{
res
=
this
(
x
-
s
,
y
-
t
,
w
+
(
x
=
s
)
*
2
,
h
+
(
y
=
t
)
+
b
);
}
set
=
res
.
set
(
res
.
rect
(
x
-
s
,
y
-
t
,
b
+
s
,
h
+
y
+
b
).
attr
({
stroke
:
none
,
fill
:
this
.
format
(
"180-{0}-{0}"
,
shadowColor
),
opacity
:
0
,
"clip-rect"
:
[
x
-
s
+
1
,
y
-
t
+
r
,
b
,
h
+
y
+
b
-
r
*
2
+
.
9
]}),
res
.
rect
(
x
+
w
-
b
,
y
-
t
,
b
+
s
,
h
+
y
+
b
).
attr
({
stroke
:
none
,
fill
:
this
.
format
(
"0-{0}-{0}"
,
shadowColor
),
opacity
:
0
,
"clip-rect"
:
[
x
+
w
-
s
+
1
,
y
-
t
+
r
,
b
,
h
+
y
+
b
-
r
*
2
]}),
res
.
rect
(
x
+
b
-
1
,
y
+
h
-
s
,
w
+
b
,
b
+
s
).
attr
({
stroke
:
none
,
fill
:
this
.
format
(
"270-{0}-{0}"
,
shadowColor
),
opacity
:
0
,
"clip-rect"
:
[
x
+
b
,
y
+
h
-
s
,
w
+
b
-
r
*
2
,
b
+
s
]}),
res
.
rect
(
x
+
s
-
1
,
y
-
t
,
w
+
b
,
b
+
s
).
attr
({
stroke
:
none
,
fill
:
this
.
format
(
"90-{0}-{0}"
,
shadowColor
),
opacity
:
0
,
"clip-rect"
:
[
x
+
b
,
y
-
t
,
w
+
b
-
r
*
2
,
s
+
t
+
1
]}),
res
.
circle
(
x
+
b
,
y
+
h
-
s
,
r
).
attr
({
stroke
:
none
,
fill
:
rg
,
opacity
:
0
,
"clip-rect"
:
[
x
-
s
,
y
+
h
-
s
+
.
999
,
r
,
r
]}),
res
.
circle
(
x
+
w
-
b
,
y
+
h
-
s
,
r
).
attr
({
stroke
:
none
,
fill
:
rg
,
opacity
:
0
,
"clip-rect"
:
[
x
+
w
-
b
,
y
+
h
-
s
,
r
,
r
]}),
res
.
circle
(
x
+
b
,
y
-
t
+
r
,
r
).
attr
({
stroke
:
none
,
fill
:
rg
,
opacity
:
0
,
"clip-rect"
:
[
x
-
s
,
y
-
t
,
r
,
r
]}),
res
.
circle
(
x
+
w
-
b
,
y
-
t
+
r
,
r
).
attr
({
stroke
:
none
,
fill
:
rg
,
opacity
:
0
,
"clip-rect"
:
[
x
+
w
-
b
,
y
-
t
,
r
,
r
]}),
res
.
rect
(
x
,
y
,
w
,
h
,
R
).
attr
({
fill
:
color
,
stroke
:
stroke
})
);
return
set
[
0
].
paper
;
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment