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
77636f06
authored
Dec 24, 2008
by
Dmitry Baranovskiy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0.5.12 Quick fix for patterns as well as fix for Safari & Opera.
parent
8b348280
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
raphael-packed.js
+0
-0
raphael.js
+16
-5
No files found.
raphael-packed.js
View file @
77636f06
This diff is collapsed.
Click to expand it.
raphael.js
View file @
77636f06
/*
/*
* Raphael 0.5.1
1
- JavaScript Vector Library
* Raphael 0.5.1
2
- JavaScript Vector Library
*
*
* Copyright (c) 2008 Dmitry Baranovskiy (raphaeljs.com)
* Copyright (c) 2008 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.
*/
*/
var
Raphael
=
(
function
(
type
)
{
var
Raphael
=
(
function
(
type
)
{
var
r
=
function
()
{
var
r
=
function
()
{
return
r
.
_create
.
apply
(
r
,
arguments
);
return
r
.
_create
.
apply
(
r
,
arguments
);
};
};
r
.
version
=
"0.5.1
1
"
;
r
.
version
=
"0.5.1
2
"
;
r
.
type
=
type
;
r
.
type
=
type
;
var
C
=
{};
var
C
=
{};
function
Matrix
(
m11
,
m12
,
m21
,
m22
,
dx
,
dy
)
{
function
Matrix
(
m11
,
m12
,
m21
,
m22
,
dx
,
dy
)
{
...
@@ -984,6 +984,12 @@ var Raphael = (function (type) {
...
@@ -984,6 +984,12 @@ var Raphael = (function (type) {
};
};
o
.
setAttribute
(
"fill"
,
"url(#"
+
el
.
id
+
")"
);
o
.
setAttribute
(
"fill"
,
"url(#"
+
el
.
id
+
")"
);
};
};
var
updatePosition
=
function
(
o
)
{
if
(
o
.
pattern
)
{
var
bbox
=
o
.
node
.
getBBox
();
o
.
pattern
.
setAttribute
(
"patternTransform"
,
"translate("
+
[
bbox
.
x
,
bbox
.
y
].
join
(
","
)
+
")"
);
}
};
var
setFillAndStroke
=
function
(
o
,
params
)
{
var
setFillAndStroke
=
function
(
o
,
params
)
{
var
dasharray
=
{
var
dasharray
=
{
"-"
:
[
3
,
1
],
"-"
:
[
3
,
1
],
...
@@ -1005,11 +1011,13 @@ var Raphael = (function (type) {
...
@@ -1005,11 +1011,13 @@ var Raphael = (function (type) {
case
"cx"
:
case
"cx"
:
case
"x"
:
case
"x"
:
o
[
0
].
setAttribute
(
att
,
o
.
svg
.
_getX
(
value
));
o
[
0
].
setAttribute
(
att
,
o
.
svg
.
_getX
(
value
));
updatePosition
(
o
);
break
;
break
;
case
"ry"
:
case
"ry"
:
case
"cy"
:
case
"cy"
:
case
"y"
:
case
"y"
:
o
[
0
].
setAttribute
(
att
,
o
.
svg
.
_getY
(
value
));
o
[
0
].
setAttribute
(
att
,
o
.
svg
.
_getY
(
value
));
updatePosition
(
o
);
break
;
break
;
case
"width"
:
case
"width"
:
o
[
0
].
setAttribute
(
att
,
o
.
svg
.
_getW
(
value
));
o
[
0
].
setAttribute
(
att
,
o
.
svg
.
_getW
(
value
));
...
@@ -1044,7 +1052,6 @@ var Raphael = (function (type) {
...
@@ -1044,7 +1052,6 @@ var Raphael = (function (type) {
if
(
isURL
)
{
if
(
isURL
)
{
var
el
=
document
.
createElementNS
(
o
.
svg
.
svgns
,
"pattern"
);
var
el
=
document
.
createElementNS
(
o
.
svg
.
svgns
,
"pattern"
);
var
ig
=
document
.
createElementNS
(
o
.
svg
.
svgns
,
"image"
);
var
ig
=
document
.
createElementNS
(
o
.
svg
.
svgns
,
"image"
);
console
.
log
(
isURL
);
el
.
id
=
"raphael-pattern-"
+
o
.
svg
.
gradients
++
;
el
.
id
=
"raphael-pattern-"
+
o
.
svg
.
gradients
++
;
el
.
setAttribute
(
"x"
,
0
);
el
.
setAttribute
(
"x"
,
0
);
el
.
setAttribute
(
"y"
,
0
);
el
.
setAttribute
(
"y"
,
0
);
...
@@ -1053,8 +1060,8 @@ var Raphael = (function (type) {
...
@@ -1053,8 +1060,8 @@ var Raphael = (function (type) {
ig
.
setAttribute
(
"y"
,
0
);
ig
.
setAttribute
(
"y"
,
0
);
ig
.
setAttributeNS
(
o
.
svg
.
xlink
,
"href"
,
isURL
[
1
]);
ig
.
setAttributeNS
(
o
.
svg
.
xlink
,
"href"
,
isURL
[
1
]);
el
.
appendChild
(
ig
);
el
.
appendChild
(
ig
);
var
img
=
document
.
createElement
(
"img"
);
var
img
=
document
.
createElement
(
"img"
);
img
.
src
=
isURL
[
1
];
img
.
style
.
position
=
"absolute"
;
img
.
style
.
position
=
"absolute"
;
img
.
style
.
top
=
"-9999em"
;
img
.
style
.
top
=
"-9999em"
;
img
.
style
.
left
=
"-9999em"
;
img
.
style
.
left
=
"-9999em"
;
...
@@ -1066,9 +1073,13 @@ var Raphael = (function (type) {
...
@@ -1066,9 +1073,13 @@ var Raphael = (function (type) {
document
.
body
.
removeChild
(
this
);
document
.
body
.
removeChild
(
this
);
};
};
document
.
body
.
appendChild
(
img
);
document
.
body
.
appendChild
(
img
);
img
.
src
=
isURL
[
1
];
o
.
svg
.
defs
.
appendChild
(
el
);
o
.
svg
.
defs
.
appendChild
(
el
);
o
[
0
].
style
.
fill
=
"url(#"
+
el
.
id
+
")"
;
o
[
0
].
style
.
fill
=
"url(#"
+
el
.
id
+
")"
;
o
[
0
].
setAttribute
(
"fill"
,
"url(#"
+
el
.
id
+
")"
);
o
[
0
].
setAttribute
(
"fill"
,
"url(#"
+
el
.
id
+
")"
);
o
.
pattern
=
el
;
updatePosition
(
o
);
C
.
safari
();
break
;
break
;
}
}
default
:
default
:
...
...
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