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
66450da2
Commit
66450da2
authored
Apr 04, 2011
by
Dmitry Baranovskiy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed wrong viewBox in IE, matrix invert method, pathDimention caching.
parent
88a59f8b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
12 deletions
+31
-12
raphael-min.js
raphael-min.js
+1
-1
raphael.js
raphael.js
+30
-11
No files found.
raphael-min.js
View file @
66450da2
This source diff could not be displayed because it is too large. You can
view the blob
instead.
raphael.js
View file @
66450da2
...
@@ -1026,6 +1026,13 @@
...
@@ -1026,6 +1026,13 @@
width
:
mmax
[
apply
](
0
,
X
)
-
xmin
,
width
:
mmax
[
apply
](
0
,
X
)
-
xmin
,
height
:
mmax
[
apply
](
0
,
Y
)
-
ymin
height
:
mmax
[
apply
](
0
,
Y
)
-
ymin
};
};
},
null
,
function
(
o
)
{
return
{
x
:
o
.
x
,
y
:
o
.
y
,
width
:
o
.
width
,
height
:
o
.
height
};
}),
}),
pathClone
=
function
(
pathArray
)
{
pathClone
=
function
(
pathArray
)
{
var
res
=
[];
var
res
=
[];
...
@@ -1716,12 +1723,12 @@
...
@@ -1716,12 +1723,12 @@
};
};
function
Matrix
(
a
,
b
,
c
,
d
,
e
,
f
)
{
function
Matrix
(
a
,
b
,
c
,
d
,
e
,
f
)
{
if
(
a
!=
null
)
{
if
(
a
!=
null
)
{
this
.
a
=
a
;
this
.
a
=
+
a
;
this
.
b
=
b
;
this
.
b
=
+
b
;
this
.
c
=
c
;
this
.
c
=
+
c
;
this
.
d
=
d
;
this
.
d
=
+
d
;
this
.
e
=
e
;
this
.
e
=
+
e
;
this
.
f
=
f
;
this
.
f
=
+
f
;
}
else
{
}
else
{
this
.
a
=
1
;
this
.
a
=
1
;
this
.
b
=
0
;
this
.
b
=
0
;
...
@@ -1759,8 +1766,9 @@
...
@@ -1759,8 +1766,9 @@
this
.
f
=
out
[
1
][
2
];
this
.
f
=
out
[
1
][
2
];
};
};
matrixproto
.
invert
=
function
()
{
matrixproto
.
invert
=
function
()
{
var
x
=
a
*
d
-
b
*
c
;
var
me
=
this
,
return
new
Matrix
(
d
/
x
,
-
b
/
x
,
-
c
/
x
,
a
/
x
,
(
c
*
f
-
d
*
e
)
/
x
,
(
b
*
e
-
a
*
f
)
/
x
);
x
=
me
.
a
*
me
.
d
-
me
.
b
*
me
.
c
;
return
new
Matrix
(
me
.
d
/
x
,
-
me
.
b
/
x
,
-
me
.
c
/
x
,
me
.
a
/
x
,
(
me
.
c
*
me
.
f
-
me
.
d
*
me
.
e
)
/
x
,
(
me
.
b
*
me
.
e
-
me
.
a
*
me
.
f
)
/
x
);
};
};
matrixproto
.
clone
=
function
()
{
matrixproto
.
clone
=
function
()
{
return
new
Matrix
(
this
.
a
,
this
.
b
,
this
.
c
,
this
.
d
,
this
.
e
,
this
.
f
);
return
new
Matrix
(
this
.
a
,
this
.
b
,
this
.
c
,
this
.
d
,
this
.
e
,
this
.
f
);
...
@@ -2595,7 +2603,7 @@
...
@@ -2595,7 +2603,7 @@
\*/
\*/
elproto
.
transform
=
function
(
tstr
)
{
elproto
.
transform
=
function
(
tstr
)
{
var
_
=
this
.
_
;
var
_
=
this
.
_
;
if
(
!
tstr
)
{
if
(
tstr
==
null
)
{
return
_
.
transform
;
return
_
.
transform
;
}
}
extractTransform
(
this
,
tstr
);
extractTransform
(
this
,
tstr
);
...
@@ -3525,8 +3533,13 @@
...
@@ -3525,8 +3533,13 @@
}
}
extractTransform
(
this
,
tstr
);
extractTransform
(
this
,
tstr
);
var
matrix
=
this
.
matrix
.
clone
(),
var
matrix
=
this
.
matrix
.
clone
(),
vbs
=
this
.
paper
.
_viewBoxShift
,
skew
=
this
.
skew
;
skew
=
this
.
skew
;
matrix
.
translate
(
-
.
5
,
-
.
5
);
matrix
.
translate
(
-
.
5
,
-
.
5
);
if
(
vbs
)
{
matrix
.
scale
(
vbs
.
scale
,
vbs
.
scale
,
-
1
,
-
1
);
matrix
.
add
(
1
,
0
,
0
,
1
,
vbs
.
dx
,
vbs
.
dy
);
}
if
(
this
.
type
==
"image"
)
{
if
(
this
.
type
==
"image"
)
{
if
(
Str
(
tstr
).
indexOf
(
"m"
)
+
1
)
{
if
(
Str
(
tstr
).
indexOf
(
"m"
)
+
1
)
{
this
.
node
.
style
.
filter
=
matrix
.
toFilter
();
this
.
node
.
style
.
filter
=
matrix
.
toFilter
();
...
@@ -3551,7 +3564,7 @@
...
@@ -3551,7 +3564,7 @@
// angle = fill.angle;
// angle = fill.angle;
this
.
node
.
style
.
filter
=
E
;
this
.
node
.
style
.
filter
=
E
;
skew
.
matrix
=
matrix
;
skew
.
matrix
=
Str
(
matrix
)
;
skew
.
offset
=
matrix
.
offset
();
skew
.
offset
=
matrix
.
offset
();
// if (0&&angle) {
// if (0&&angle) {
...
@@ -3922,7 +3935,7 @@
...
@@ -3922,7 +3935,7 @@
eve
(
"setViewBox"
,
this
,
this
.
_viewBox
,
[
x
,
y
,
w
,
h
,
fit
]);
eve
(
"setViewBox"
,
this
,
this
.
_viewBox
,
[
x
,
y
,
w
,
h
,
fit
]);
var
width
=
this
.
width
,
var
width
=
this
.
width
,
height
=
this
.
height
,
height
=
this
.
height
,
size
=
1
e3
*
mmax
(
w
/
width
,
h
/
height
),
size
=
1
/
mmax
(
w
/
width
,
h
/
height
),
H
,
W
;
H
,
W
;
if
(
fit
)
{
if
(
fit
)
{
H
=
height
/
h
;
H
=
height
/
h
;
...
@@ -3935,6 +3948,11 @@
...
@@ -3935,6 +3948,11 @@
}
}
}
}
this
.
_viewBox
=
[
x
,
y
,
w
,
h
,
!!
fit
];
this
.
_viewBox
=
[
x
,
y
,
w
,
h
,
!!
fit
];
this
.
_viewBoxShift
=
{
dx
:
-
x
,
dy
:
-
y
,
scale
:
size
};
this
.
forEach
(
function
(
el
)
{
this
.
forEach
(
function
(
el
)
{
el
.
transform
(
"..."
);
el
.
transform
(
"..."
);
});
});
...
@@ -4612,6 +4630,7 @@
...
@@ -4612,6 +4630,7 @@
}
}
_
.
bbox
=
pathDimensions
(
mapPath
(
this
.
realPath
,
this
.
matrix
));
_
.
bbox
=
pathDimensions
(
mapPath
(
this
.
realPath
,
this
.
matrix
));
_
.
bbox
.
toString
=
x_y_w_h
;
_
.
bbox
.
toString
=
x_y_w_h
;
console
.
log
(
mapPath
(
this
.
realPath
,
this
.
matrix
)
+
""
);
_
.
dirty
=
_
.
dirtyT
=
0
;
_
.
dirty
=
_
.
dirtyT
=
0
;
}
}
return
_
.
bbox
;
return
_
.
bbox
;
...
...
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