Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
殷洪(管理员)
/
raphael
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Registry
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
59524ab7
authored
Jul 26, 2011
by
Dmitry Baranovskiy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Splitting fixes
parent
f7cbfd3d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
26 deletions
+37
-26
raphael-min.js
+0
-0
raphael.core.js
+7
-2
raphael.js
+15
-12
raphael.svg.js
+11
-9
raphael.vml.js
+4
-3
No files found.
raphael-min.js
View file @
59524ab7
This source diff could not be displayed because it is too large. You can
view the blob
instead.
raphael.core.js
View file @
59524ab7
...
...
@@ -3895,9 +3895,14 @@
var
prev
=
i
&&
font
.
glyphs
[
letters
[
i
-
1
]]
||
{},
curr
=
font
.
glyphs
[
letters
[
i
]];
shift
+=
i
?
(
prev
.
w
||
font
.
w
)
+
(
prev
.
k
&&
prev
.
k
[
letters
[
i
]]
||
0
)
+
(
font
.
w
*
letter_spacing
)
:
0
;
curr
&&
curr
.
d
&&
out
.
push
(
this
.
path
(
curr
.
d
).
attr
({
fill
:
"#000"
,
stroke
:
"none"
,
transform
:
[[
"t"
,
shift
,
0
]]}));
curr
&&
curr
.
d
&&
out
.
push
(
this
.
path
(
curr
.
d
).
attr
({
fill
:
"#000"
,
stroke
:
"none"
,
transform
:
[[
"t"
,
shift
*
scale
,
0
]]
}));
}
out
.
scale
(
scale
,
scale
,
top
,
height
).
translate
(
x
-
top
,
y
-
height
);
out
.
transform
([
"...s"
,
scale
,
scale
,
top
,
height
,
"t"
,
(
x
-
top
)
/
scale
,
(
y
-
height
)
/
scale
]);
// out.scale(scale, scale, top, height).translate(x - top, y - height);
}
return
out
;
};
...
...
raphael.js
View file @
59524ab7
...
...
@@ -4236,7 +4236,9 @@ window.Raphael.svg && function (R) {
math
=
Math
,
mmax
=
math
.
max
,
abs
=
math
.
abs
,
pow
=
math
.
pow
,
separator
=
/
[
,
]
+/
,
eve
=
R
.
eve
,
E
=
""
;
// SVG
var
xlink
=
"http://www.w3.org/1999/xlink"
,
...
...
@@ -4276,7 +4278,7 @@ window.Raphael.svg && function (R) {
oid
=
oid
&&
oid
.
match
(
rgGrad
);
if
(
oid
&&
!--
gradients
[
oid
[
1
]])
{
delete
gradients
[
oid
[
1
]];
paper
.
defs
.
removeChild
(
g
.
doc
.
getElementById
(
oid
[
1
]));
paper
.
defs
.
removeChild
(
R
.
_
g
.
doc
.
getElementById
(
oid
[
1
]));
}
},
addGradientFill
=
function
(
element
,
gradient
)
{
...
...
@@ -4430,7 +4432,7 @@ window.Raphael.svg && function (R) {
if
(
type
!=
"none"
)
{
var
pathId
=
"raphael-marker-"
+
type
,
markerId
=
"raphael-marker-"
+
se
+
type
+
w
+
h
;
if
(
!
g
.
doc
.
getElementById
(
pathId
))
{
if
(
!
R
.
_
g
.
doc
.
getElementById
(
pathId
))
{
p
.
defs
.
appendChild
(
$
(
$
(
"path"
),
{
"stroke-linecap"
:
"round"
,
d
:
markers
[
type
],
...
...
@@ -4440,7 +4442,7 @@ window.Raphael.svg && function (R) {
}
else
{
markerCounter
[
pathId
]
++
;
}
var
marker
=
g
.
doc
.
getElementById
(
markerId
),
var
marker
=
R
.
_
g
.
doc
.
getElementById
(
markerId
),
use
;
if
(
!
marker
)
{
marker
=
$
(
$
(
"marker"
),
{
...
...
@@ -4499,7 +4501,7 @@ window.Raphael.svg && function (R) {
delete
o
.
_
.
arrows
[
se
+
"String"
];
}
for
(
attr
in
markerCounter
)
if
(
markerCounter
[
has
](
attr
)
&&
!
markerCounter
[
attr
])
{
var
item
=
g
.
doc
.
getElementById
(
attr
);
var
item
=
R
.
_
g
.
doc
.
getElementById
(
attr
);
item
&&
item
.
parentNode
.
removeChild
(
item
);
}
}
...
...
@@ -4522,7 +4524,7 @@ window.Raphael.svg && function (R) {
node
=
o
.
node
,
attrs
=
o
.
attrs
,
addDashes
=
function
(
o
,
value
)
{
value
=
dasharray
[
lowerCase
.
call
(
value
)];
value
=
dasharray
[
Str
(
value
).
toLowerCase
(
)];
if
(
value
)
{
var
width
=
o
.
attrs
[
"stroke-width"
]
||
"1"
,
butt
=
{
round
:
width
,
square
:
width
,
butt
:
0
}[
o
.
attrs
[
"stroke-linecap"
]
||
params
[
"stroke-linecap"
]]
||
0
,
...
...
@@ -4549,7 +4551,7 @@ window.Raphael.svg && function (R) {
case
"title"
:
case
"target"
:
var
pn
=
node
.
parentNode
;
if
(
lowerCase
.
call
(
pn
.
tagName
)
!=
"a"
)
{
if
(
pn
.
tagName
.
toLowerCase
(
)
!=
"a"
)
{
var
hl
=
$
(
"a"
);
pn
.
insertBefore
(
hl
,
node
);
hl
.
appendChild
(
node
);
...
...
@@ -4592,7 +4594,7 @@ window.Raphael.svg && function (R) {
o
.
clip
=
rc
;
}
if
(
!
value
)
{
var
clip
=
g
.
doc
.
getElementById
(
node
.
getAttribute
(
"clip-path"
).
replace
(
/
(
^url
\(
#|
\)
$
)
/g
,
E
));
var
clip
=
R
.
_
g
.
doc
.
getElementById
(
node
.
getAttribute
(
"clip-path"
).
replace
(
/
(
^url
\(
#|
\)
$
)
/g
,
E
));
clip
&&
clip
.
parentNode
.
removeChild
(
clip
);
$
(
node
,
{
"clip-path"
:
E
});
delete
o
.
clip
;
...
...
@@ -4722,7 +4724,7 @@ window.Raphael.svg && function (R) {
$
(
node
,
{
"fill-opacity"
:
attrs
[
"fill-opacity"
]});
}
else
if
((
o
.
type
==
"circle"
||
o
.
type
==
"ellipse"
||
Str
(
value
).
charAt
()
!=
"r"
)
&&
addGradientFill
(
o
,
value
))
{
if
(
"opacity"
in
attrs
||
"fill-opacity"
in
attrs
)
{
var
gradient
=
g
.
doc
.
getElementById
(
node
.
getAttribute
(
"fill"
).
replace
(
/^url
\(
#|
\)
$/g
,
E
));
var
gradient
=
R
.
_
g
.
doc
.
getElementById
(
node
.
getAttribute
(
"fill"
).
replace
(
/^url
\(
#|
\)
$/g
,
E
));
if
(
gradient
)
{
var
stops
=
gradient
.
getElementsByTagName
(
"stop"
);
$
(
stops
[
stops
.
length
-
1
],
{
"stop-opacity"
:
(
"opacity"
in
attrs
?
attrs
.
opacity
:
1
)
*
(
"fill-opacity"
in
attrs
?
attrs
[
"fill-opacity"
]
:
1
)});
...
...
@@ -4752,7 +4754,7 @@ window.Raphael.svg && function (R) {
// fall
case
"fill-opacity"
:
if
(
attrs
.
gradient
)
{
gradient
=
g
.
doc
.
getElementById
(
node
.
getAttribute
(
"fill"
).
replace
(
/^url
\(
#|
\)
$/g
,
E
));
gradient
=
R
.
_
g
.
doc
.
getElementById
(
node
.
getAttribute
(
"fill"
).
replace
(
/^url
\(
#|
\)
$/g
,
E
));
if
(
gradient
)
{
stops
=
gradient
.
getElementsByTagName
(
"stop"
);
$
(
stops
[
stops
.
length
-
1
],
{
"stop-opacity"
:
value
});
...
...
@@ -5567,6 +5569,7 @@ window.Raphael.vml && function (R) {
abs
=
math
.
abs
,
fillString
=
"fill"
,
separator
=
/
[
,
]
+/
,
eve
=
R
.
eve
,
S
=
" "
,
E
=
""
;
// VML
...
...
@@ -5586,7 +5589,7 @@ window.Raphael.vml && function (R) {
if
(
command
==
R
.
_pathToAbsolute
&&
!
Str
(
path
).
match
(
total
))
{
var
res
=
Str
(
path
).
replace
(
bites
,
function
(
all
,
command
,
args
)
{
var
vals
=
[],
isMove
=
lowerCase
.
call
(
command
)
==
"m"
,
isMove
=
command
.
toLowerCase
(
)
==
"m"
,
res
=
map
[
command
];
args
.
replace
(
val
,
function
(
value
)
{
if
(
isMove
&&
vals
.
length
==
2
)
{
...
...
@@ -5732,7 +5735,7 @@ window.Raphael.vml && function (R) {
if
(
rect
.
length
==
4
)
{
rect
[
2
]
=
+
rect
[
2
]
+
(
+
rect
[
0
]);
rect
[
3
]
=
+
rect
[
3
]
+
(
+
rect
[
1
]);
var
div
=
node
.
clipRect
||
g
.
doc
.
createElement
(
"div"
),
var
div
=
node
.
clipRect
||
R
.
_
g
.
doc
.
createElement
(
"div"
),
dstyle
=
div
.
style
,
group
=
node
.
parentNode
;
dstyle
.
clip
=
R
.
format
(
"rect({1}px {2}px {3}px {0}px)"
,
rect
);
...
...
@@ -6484,7 +6487,7 @@ window.Raphael.vml && function (R) {
R
.
prototype
.
clear
=
function
()
{
R
.
eve
(
"clear"
,
this
);
this
.
canvas
.
innerHTML
=
E
;
this
.
span
=
g
.
doc
.
createElement
(
"span"
);
this
.
span
=
R
.
_
g
.
doc
.
createElement
(
"span"
);
this
.
span
.
style
.
cssText
=
"position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;"
;
this
.
canvas
.
appendChild
(
this
.
span
);
this
.
bottom
=
this
.
top
=
null
;
...
...
raphael.svg.js
View file @
59524ab7
...
...
@@ -15,7 +15,9 @@ window.Raphael.svg && function (R) {
math
=
Math
,
mmax
=
math
.
max
,
abs
=
math
.
abs
,
pow
=
math
.
pow
,
separator
=
/
[
,
]
+/
,
eve
=
R
.
eve
,
E
=
""
;
// SVG
var
xlink
=
"http://www.w3.org/1999/xlink"
,
...
...
@@ -55,7 +57,7 @@ window.Raphael.svg && function (R) {
oid
=
oid
&&
oid
.
match
(
rgGrad
);
if
(
oid
&&
!--
gradients
[
oid
[
1
]])
{
delete
gradients
[
oid
[
1
]];
paper
.
defs
.
removeChild
(
g
.
doc
.
getElementById
(
oid
[
1
]));
paper
.
defs
.
removeChild
(
R
.
_
g
.
doc
.
getElementById
(
oid
[
1
]));
}
},
addGradientFill
=
function
(
element
,
gradient
)
{
...
...
@@ -209,7 +211,7 @@ window.Raphael.svg && function (R) {
if
(
type
!=
"none"
)
{
var
pathId
=
"raphael-marker-"
+
type
,
markerId
=
"raphael-marker-"
+
se
+
type
+
w
+
h
;
if
(
!
g
.
doc
.
getElementById
(
pathId
))
{
if
(
!
R
.
_
g
.
doc
.
getElementById
(
pathId
))
{
p
.
defs
.
appendChild
(
$
(
$
(
"path"
),
{
"stroke-linecap"
:
"round"
,
d
:
markers
[
type
],
...
...
@@ -219,7 +221,7 @@ window.Raphael.svg && function (R) {
}
else
{
markerCounter
[
pathId
]
++
;
}
var
marker
=
g
.
doc
.
getElementById
(
markerId
),
var
marker
=
R
.
_
g
.
doc
.
getElementById
(
markerId
),
use
;
if
(
!
marker
)
{
marker
=
$
(
$
(
"marker"
),
{
...
...
@@ -278,7 +280,7 @@ window.Raphael.svg && function (R) {
delete
o
.
_
.
arrows
[
se
+
"String"
];
}
for
(
attr
in
markerCounter
)
if
(
markerCounter
[
has
](
attr
)
&&
!
markerCounter
[
attr
])
{
var
item
=
g
.
doc
.
getElementById
(
attr
);
var
item
=
R
.
_
g
.
doc
.
getElementById
(
attr
);
item
&&
item
.
parentNode
.
removeChild
(
item
);
}
}
...
...
@@ -301,7 +303,7 @@ window.Raphael.svg && function (R) {
node
=
o
.
node
,
attrs
=
o
.
attrs
,
addDashes
=
function
(
o
,
value
)
{
value
=
dasharray
[
lowerCase
.
call
(
value
)];
value
=
dasharray
[
Str
(
value
).
toLowerCase
(
)];
if
(
value
)
{
var
width
=
o
.
attrs
[
"stroke-width"
]
||
"1"
,
butt
=
{
round
:
width
,
square
:
width
,
butt
:
0
}[
o
.
attrs
[
"stroke-linecap"
]
||
params
[
"stroke-linecap"
]]
||
0
,
...
...
@@ -328,7 +330,7 @@ window.Raphael.svg && function (R) {
case
"title"
:
case
"target"
:
var
pn
=
node
.
parentNode
;
if
(
lowerCase
.
call
(
pn
.
tagName
)
!=
"a"
)
{
if
(
pn
.
tagName
.
toLowerCase
(
)
!=
"a"
)
{
var
hl
=
$
(
"a"
);
pn
.
insertBefore
(
hl
,
node
);
hl
.
appendChild
(
node
);
...
...
@@ -371,7 +373,7 @@ window.Raphael.svg && function (R) {
o
.
clip
=
rc
;
}
if
(
!
value
)
{
var
clip
=
g
.
doc
.
getElementById
(
node
.
getAttribute
(
"clip-path"
).
replace
(
/
(
^url
\(
#|
\)
$
)
/g
,
E
));
var
clip
=
R
.
_
g
.
doc
.
getElementById
(
node
.
getAttribute
(
"clip-path"
).
replace
(
/
(
^url
\(
#|
\)
$
)
/g
,
E
));
clip
&&
clip
.
parentNode
.
removeChild
(
clip
);
$
(
node
,
{
"clip-path"
:
E
});
delete
o
.
clip
;
...
...
@@ -501,7 +503,7 @@ window.Raphael.svg && function (R) {
$
(
node
,
{
"fill-opacity"
:
attrs
[
"fill-opacity"
]});
}
else
if
((
o
.
type
==
"circle"
||
o
.
type
==
"ellipse"
||
Str
(
value
).
charAt
()
!=
"r"
)
&&
addGradientFill
(
o
,
value
))
{
if
(
"opacity"
in
attrs
||
"fill-opacity"
in
attrs
)
{
var
gradient
=
g
.
doc
.
getElementById
(
node
.
getAttribute
(
"fill"
).
replace
(
/^url
\(
#|
\)
$/g
,
E
));
var
gradient
=
R
.
_
g
.
doc
.
getElementById
(
node
.
getAttribute
(
"fill"
).
replace
(
/^url
\(
#|
\)
$/g
,
E
));
if
(
gradient
)
{
var
stops
=
gradient
.
getElementsByTagName
(
"stop"
);
$
(
stops
[
stops
.
length
-
1
],
{
"stop-opacity"
:
(
"opacity"
in
attrs
?
attrs
.
opacity
:
1
)
*
(
"fill-opacity"
in
attrs
?
attrs
[
"fill-opacity"
]
:
1
)});
...
...
@@ -531,7 +533,7 @@ window.Raphael.svg && function (R) {
// fall
case
"fill-opacity"
:
if
(
attrs
.
gradient
)
{
gradient
=
g
.
doc
.
getElementById
(
node
.
getAttribute
(
"fill"
).
replace
(
/^url
\(
#|
\)
$/g
,
E
));
gradient
=
R
.
_
g
.
doc
.
getElementById
(
node
.
getAttribute
(
"fill"
).
replace
(
/^url
\(
#|
\)
$/g
,
E
));
if
(
gradient
)
{
stops
=
gradient
.
getElementsByTagName
(
"stop"
);
$
(
stops
[
stops
.
length
-
1
],
{
"stop-opacity"
:
value
});
...
...
raphael.vml.js
View file @
59524ab7
...
...
@@ -18,6 +18,7 @@ window.Raphael.vml && function (R) {
abs
=
math
.
abs
,
fillString
=
"fill"
,
separator
=
/
[
,
]
+/
,
eve
=
R
.
eve
,
S
=
" "
,
E
=
""
;
// VML
...
...
@@ -37,7 +38,7 @@ window.Raphael.vml && function (R) {
if
(
command
==
R
.
_pathToAbsolute
&&
!
Str
(
path
).
match
(
total
))
{
var
res
=
Str
(
path
).
replace
(
bites
,
function
(
all
,
command
,
args
)
{
var
vals
=
[],
isMove
=
lowerCase
.
call
(
command
)
==
"m"
,
isMove
=
command
.
toLowerCase
(
)
==
"m"
,
res
=
map
[
command
];
args
.
replace
(
val
,
function
(
value
)
{
if
(
isMove
&&
vals
.
length
==
2
)
{
...
...
@@ -183,7 +184,7 @@ window.Raphael.vml && function (R) {
if
(
rect
.
length
==
4
)
{
rect
[
2
]
=
+
rect
[
2
]
+
(
+
rect
[
0
]);
rect
[
3
]
=
+
rect
[
3
]
+
(
+
rect
[
1
]);
var
div
=
node
.
clipRect
||
g
.
doc
.
createElement
(
"div"
),
var
div
=
node
.
clipRect
||
R
.
_
g
.
doc
.
createElement
(
"div"
),
dstyle
=
div
.
style
,
group
=
node
.
parentNode
;
dstyle
.
clip
=
R
.
format
(
"rect({1}px {2}px {3}px {0}px)"
,
rect
);
...
...
@@ -935,7 +936,7 @@ window.Raphael.vml && function (R) {
R
.
prototype
.
clear
=
function
()
{
R
.
eve
(
"clear"
,
this
);
this
.
canvas
.
innerHTML
=
E
;
this
.
span
=
g
.
doc
.
createElement
(
"span"
);
this
.
span
=
R
.
_
g
.
doc
.
createElement
(
"span"
);
this
.
span
.
style
.
cssText
=
"position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;"
;
this
.
canvas
.
appendChild
(
this
.
span
);
this
.
bottom
=
this
.
top
=
null
;
...
...
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