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
23a57b66
authored
Sep 10, 2009
by
Dmitry Baranovskiy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RC1.1 Fixed rounding bug in a2c method.
parent
b99f4f8b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
9 deletions
+15
-9
raphael-min.js
+0
-0
raphael.js
+15
-9
No files found.
raphael-min.js
View file @
23a57b66
This source diff could not be displayed because it is too large. You can
view the blob
instead.
raphael.js
View file @
23a57b66
/*
/*
* Raphael 1.0 RC1 - JavaScript Vector Library
* Raphael 1.0 RC1
.1
- JavaScript Vector Library
*
*
* Copyright (c) 2008 - 2009 Dmitry Baranovskiy (http://raphaeljs.com)
* Copyright (c) 2008 - 2009 Dmitry Baranovskiy (http://raphaeljs.com)
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
...
@@ -21,7 +21,7 @@ window.Raphael = (function () {
...
@@ -21,7 +21,7 @@ window.Raphael = (function () {
availableAttrs
=
{
cx
:
0
,
cy
:
0
,
fill
:
"#fff"
,
"fill-opacity"
:
1
,
font
:
'10px "Arial"'
,
"font-family"
:
'"Arial"'
,
"font-size"
:
"10"
,
"font-style"
:
"normal"
,
"font-weight"
:
400
,
gradient
:
0
,
height
:
0
,
href
:
"http://raphaeljs.com/"
,
opacity
:
1
,
path
:
"M0,0"
,
r
:
0
,
rotation
:
0
,
rx
:
0
,
ry
:
0
,
scale
:
"1 1"
,
src
:
""
,
stroke
:
"#000"
,
"stroke-dasharray"
:
""
,
"stroke-linecap"
:
"butt"
,
"stroke-linejoin"
:
"butt"
,
"stroke-miterlimit"
:
0
,
"stroke-opacity"
:
1
,
"stroke-width"
:
1
,
target
:
"_blank"
,
"text-anchor"
:
"middle"
,
title
:
"Raphael"
,
translation
:
"0 0"
,
width
:
0
,
x
:
0
,
y
:
0
},
availableAttrs
=
{
cx
:
0
,
cy
:
0
,
fill
:
"#fff"
,
"fill-opacity"
:
1
,
font
:
'10px "Arial"'
,
"font-family"
:
'"Arial"'
,
"font-size"
:
"10"
,
"font-style"
:
"normal"
,
"font-weight"
:
400
,
gradient
:
0
,
height
:
0
,
href
:
"http://raphaeljs.com/"
,
opacity
:
1
,
path
:
"M0,0"
,
r
:
0
,
rotation
:
0
,
rx
:
0
,
ry
:
0
,
scale
:
"1 1"
,
src
:
""
,
stroke
:
"#000"
,
"stroke-dasharray"
:
""
,
"stroke-linecap"
:
"butt"
,
"stroke-linejoin"
:
"butt"
,
"stroke-miterlimit"
:
0
,
"stroke-opacity"
:
1
,
"stroke-width"
:
1
,
target
:
"_blank"
,
"text-anchor"
:
"middle"
,
title
:
"Raphael"
,
translation
:
"0 0"
,
width
:
0
,
x
:
0
,
y
:
0
},
availableAnimAttrs
=
{
cx
:
"number"
,
cy
:
"number"
,
fill
:
"colour"
,
"fill-opacity"
:
"number"
,
"font-size"
:
"number"
,
height
:
"number"
,
opacity
:
"number"
,
path
:
"path"
,
r
:
"number"
,
rotation
:
"csv"
,
rx
:
"number"
,
ry
:
"number"
,
scale
:
"csv"
,
stroke
:
"colour"
,
"stroke-opacity"
:
"number"
,
"stroke-width"
:
"number"
,
translation
:
"csv"
,
width
:
"number"
,
x
:
"number"
,
y
:
"number"
},
availableAnimAttrs
=
{
cx
:
"number"
,
cy
:
"number"
,
fill
:
"colour"
,
"fill-opacity"
:
"number"
,
"font-size"
:
"number"
,
height
:
"number"
,
opacity
:
"number"
,
path
:
"path"
,
r
:
"number"
,
rotation
:
"csv"
,
rx
:
"number"
,
ry
:
"number"
,
scale
:
"csv"
,
stroke
:
"colour"
,
"stroke-opacity"
:
"number"
,
"stroke-width"
:
"number"
,
translation
:
"csv"
,
width
:
"number"
,
x
:
"number"
,
y
:
"number"
},
events
=
[
"click"
,
"dblclick"
,
"mousedown"
,
"mousemove"
,
"mouseout"
,
"mouseover"
,
"mouseup"
];
events
=
[
"click"
,
"dblclick"
,
"mousedown"
,
"mousemove"
,
"mouseout"
,
"mouseover"
,
"mouseup"
];
R
.
version
=
"1.0 RC1"
;
R
.
version
=
"1.0 RC1
.1
"
;
R
.
type
=
(
window
.
SVGAngle
||
document
.
implementation
.
hasFeature
(
"http://www.w3.org/TR/SVG11/feature#BasicStructure"
,
"1.1"
)
?
"SVG"
:
"VML"
);
R
.
type
=
(
window
.
SVGAngle
||
document
.
implementation
.
hasFeature
(
"http://www.w3.org/TR/SVG11/feature#BasicStructure"
,
"1.1"
)
?
"SVG"
:
"VML"
);
R
.
svg
=
!
(
R
.
vml
=
R
.
type
==
"VML"
);
R
.
svg
=
!
(
R
.
vml
=
R
.
type
==
"VML"
);
R
.
idGenerator
=
0
;
R
.
idGenerator
=
0
;
...
@@ -265,6 +265,9 @@ window.Raphael = (function () {
...
@@ -265,6 +265,9 @@ window.Raphael = (function () {
return
data
;
return
data
;
});
});
var
pathDimensions
=
cacher
(
function
(
path
)
{
var
pathDimensions
=
cacher
(
function
(
path
)
{
if
(
!
path
)
{
return
{
x
:
0
,
y
:
0
,
width
:
0
,
height
:
0
};
}
path
=
path2curve
(
path
);
path
=
path2curve
(
path
);
var
x
=
0
,
var
x
=
0
,
y
=
0
,
y
=
0
,
...
@@ -491,7 +494,7 @@ window.Raphael = (function () {
...
@@ -491,7 +494,7 @@ window.Raphael = (function () {
var
rx2
=
rx
*
rx
,
var
rx2
=
rx
*
rx
,
ry2
=
ry
*
ry
,
ry2
=
ry
*
ry
,
k
=
(
large_arc_flag
==
sweep_flag
?
-
1
:
1
)
*
k
=
(
large_arc_flag
==
sweep_flag
?
-
1
:
1
)
*
Math
.
sqrt
(
(
rx2
*
ry2
-
rx2
*
y
*
y
-
ry2
*
x
*
x
)
/
(
rx2
*
y
*
y
+
ry2
*
x
*
x
)),
Math
.
sqrt
(
Math
.
abs
((
rx2
*
ry2
-
rx2
*
y
*
y
-
ry2
*
x
*
x
)
/
(
rx2
*
y
*
y
+
ry2
*
x
*
x
)
)),
cx
=
k
*
rx
*
y
/
ry
+
(
x1
+
x2
)
/
2
,
cx
=
k
*
rx
*
y
/
ry
+
(
x1
+
x2
)
/
2
,
cy
=
k
*
-
ry
*
x
/
rx
+
(
y1
+
y2
)
/
2
,
cy
=
k
*
-
ry
*
x
/
rx
+
(
y1
+
y2
)
/
2
,
f1
=
Math
.
asin
((
y1
-
cy
)
/
ry
),
f1
=
Math
.
asin
((
y1
-
cy
)
/
ry
),
...
@@ -2196,11 +2199,7 @@ window.Raphael = (function () {
...
@@ -2196,11 +2199,7 @@ window.Raphael = (function () {
return
theEllipse
(
this
,
x
,
y
,
rx
,
ry
);
return
theEllipse
(
this
,
x
,
y
,
rx
,
ry
);
};
};
paper
.
path
=
function
(
pathString
)
{
paper
.
path
=
function
(
pathString
)
{
var
args
=
R
.
isArray
(
arguments
[
1
])
?
[
0
].
concat
(
arguments
[
1
])
:
arguments
;
return
thePath
(
R
.
format
.
apply
(
R
,
arguments
),
this
);
pathString
&&
typeof
pathString
==
"string"
&&
args
.
length
-
1
&&
(
pathString
=
pathString
.
replace
(
/
\{(\d
+
)\}
/g
,
function
(
str
,
i
)
{
return
args
[
++
i
]
||
0
;
}));
return
thePath
(
pathString
,
this
);
};
};
paper
.
image
=
function
(
src
,
x
,
y
,
w
,
h
)
{
paper
.
image
=
function
(
src
,
x
,
y
,
w
,
h
)
{
return
theImage
(
this
,
src
,
x
,
y
,
w
,
h
);
return
theImage
(
this
,
src
,
x
,
y
,
w
,
h
);
...
@@ -2229,7 +2228,7 @@ window.Raphael = (function () {
...
@@ -2229,7 +2228,7 @@ window.Raphael = (function () {
dcy
,
dcy
,
a
=
this
.
attrs
;
a
=
this
.
attrs
;
if
(
x
!=
0
)
{
if
(
x
!=
0
)
{
var
bb
=
this
.
type
==
"path"
?
pathDimensions
(
a
.
path
)
:
this
.
getBBox
(),
var
bb
=
this
.
getBBox
(),
rcx
=
bb
.
x
+
bb
.
width
/
2
,
rcx
=
bb
.
x
+
bb
.
width
/
2
,
rcy
=
bb
.
y
+
bb
.
height
/
2
,
rcy
=
bb
.
y
+
bb
.
height
/
2
,
kx
=
x
/
this
.
_
.
sx
,
kx
=
x
/
this
.
_
.
sx
,
...
@@ -2704,6 +2703,13 @@ window.Raphael = (function () {
...
@@ -2704,6 +2703,13 @@ window.Raphael = (function () {
return
out
;
return
out
;
};
};
R
.
format
=
function
(
token
)
{
var
args
=
R
.
isArray
(
arguments
[
1
])
?
[
0
].
concat
(
arguments
[
1
])
:
arguments
;
token
&&
typeof
token
==
"string"
&&
args
.
length
-
1
&&
(
token
=
token
.
replace
(
/
\{(\d
+
)\}
/g
,
function
(
str
,
i
)
{
return
args
[
++
i
]
||
""
;
}));
return
token
;
};
R
.
ninja
=
function
()
{
R
.
ninja
=
function
()
{
var
r
=
window
.
Raphael
;
var
r
=
window
.
Raphael
;
if
(
oldRaphael
.
was
)
{
if
(
oldRaphael
.
was
)
{
...
...
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