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
e1fb048f
Commit
e1fb048f
authored
Aug 16, 2011
by
Dmitry Baranovskiy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Animation status fix
parent
951f8fb6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
28 deletions
+46
-28
raphael-min.js
raphael-min.js
+1
-1
raphael.core.js
raphael.core.js
+26
-15
raphael.js
raphael.js
+19
-12
No files found.
raphael-min.js
View file @
e1fb048f
This source diff could not be displayed because it is too large. You can
view the blob
instead.
raphael.core.js
View file @
e1fb048f
...
...
@@ -204,7 +204,7 @@
commaSpaces
=
/
\s
*,
\s
*/
,
hsrg
=
{
hs
:
1
,
rg
:
1
},
p2s
=
/,
?([
achlmqrstvxz
])
,
?
/gi
,
pathCommand
=
/
([
achlmqstvz
])[\s
,
]
*
((
-
?\d
*
\.?\d
*
(?:
e
[\-
+
]?\d
+
)?\s
*,
?\s
*
)
+
)
/ig
,
pathCommand
=
/
([
achlm
r
qstvz
])[\s
,
]
*
((
-
?\d
*
\.?\d
*
(?:
e
[\-
+
]?\d
+
)?\s
*,
?\s
*
)
+
)
/ig
,
tCommand
=
/
([
rstm
])[\s
,
]
*
((
-
?\d
*
\.?\d
*
(?:
e
[\-
+
]?\d
+
)?\s
*,
?\s
*
)
+
)
/ig
,
pathValues
=
/
(
-
?\d
*
\.?\d
*
(?:
e
[\-
+
]?\d
+
)?)\s
*,
?\s
*/ig
,
radial_gradient
=
R
.
_radial_gradient
=
/^r
(?:\(([^
,
]
+
?)\s
*,
\s
*
([^\)]
+
?)\))?
/
,
...
...
@@ -1005,7 +1005,7 @@
if
(
!
pathString
)
{
return
null
;
}
var
paramCounts
=
{
a
:
7
,
c
:
6
,
h
:
1
,
l
:
2
,
m
:
2
,
q
:
4
,
s
:
4
,
t
:
2
,
v
:
1
,
z
:
0
},
var
paramCounts
=
{
a
:
7
,
c
:
6
,
h
:
1
,
l
:
2
,
m
:
2
,
r
:
4
,
q
:
4
,
s
:
4
,
t
:
2
,
v
:
1
,
z
:
0
},
data
=
[];
if
(
R
.
is
(
pathString
,
array
)
&&
R
.
is
(
pathString
[
0
],
array
))
{
// rough assumption
data
=
pathClone
(
pathString
);
...
...
@@ -3499,22 +3499,24 @@
**
> Parameters
**
- params (object) final attributes for the element, see also @Element.attr
- ms (number) number of milliseconds for animation to run
- element (object) element to sync with
- anim (object) animation to sync with
- params (object) #optional final attributes for the element, see also @Element.attr
- ms (number) #optional number of milliseconds for animation to run
- easing (string) #optional easing type. Accept on of @Raphael.easing_formulas or CSS format: `cubic‐bezier(XX, XX, XX, XX)`
- callback (function) #optional callback function. Will be called at the end of animation.
* or
- animation (object) animation object, see @Raphael.animation
- element (object) element to sync with
- anim (object) animation to sync with
- animation (object) #optional animation object, see @Raphael.animation
**
= (object) original element
\*/
elproto
.
animateWith
=
function
(
element
,
params
,
ms
,
easing
,
callback
)
{
// var a = R.animation(params, ms, easing, callback);
// status = element.status(anim);
// this.animate(a);
// this.status(a, status);
this
.
animate
(
params
,
ms
,
easing
,
callback
);
return
this
;
elproto
.
animateWith
=
function
(
element
,
anim
,
params
,
ms
,
easing
,
callback
)
{
var
a
=
params
?
R
.
animation
(
params
,
ms
,
easing
,
callback
)
:
anim
;
status
=
element
.
status
(
anim
);
this
.
animate
(
a
);
return
this
.
status
(
a
,
status
*
anim
.
ms
/
a
.
ms
);
};
function
CubicBezierAtTime
(
t
,
p1x
,
p1y
,
p2x
,
p2y
,
duration
)
{
var
cx
=
3
*
p1x
,
...
...
@@ -3811,13 +3813,16 @@
totalOrigin
:
totalOrigin
};
animationElements
.
push
(
e
);
if
(
status
&&
!
isInAnim
)
{
if
(
status
&&
!
isInAnim
&&
!
isInAnimSet
)
{
e
.
stop
=
true
;
e
.
start
=
new
Date
-
ms
*
status
;
if
(
animationElements
.
length
==
1
)
{
return
animation
();
}
}
if
(
isInAnimSet
)
{
e
.
start
=
new
Date
-
e
.
ms
*
status
;
}
animationElements
.
length
==
1
&&
requestAnimFrame
(
animation
);
}
else
{
isInAnim
.
initstatus
=
status
;
...
...
@@ -3842,6 +3847,9 @@
= (object) @Animation
\*/
R
.
animation
=
function
(
params
,
ms
,
easing
,
callback
)
{
if
(
params
instanceof
Animation
)
{
return
params
;
}
if
(
R
.
is
(
easing
,
"function"
)
||
!
easing
)
{
callback
=
callback
||
easing
||
null
;
easing
=
null
;
...
...
@@ -3949,7 +3957,10 @@
if
(
anim
)
{
return
e
.
status
;
}
out
.
push
({
anim
:
e
.
anim
,
status
:
e
.
status
});
out
.
push
({
anim
:
e
.
anim
,
status
:
e
.
status
});
}
}
if
(
anim
)
{
...
...
@@ -4200,7 +4211,7 @@
!--
len
&&
callback
.
call
(
set
);
});
easing
=
R
.
is
(
easing
,
string
)
?
easing
:
collector
;
var
anim
=
params
instanceof
Animation
?
params
:
R
.
animation
(
params
,
ms
,
easing
,
collector
);
var
anim
=
R
.
animation
(
params
,
ms
,
easing
,
collector
);
item
=
this
.
items
[
--
i
].
animate
(
anim
);
while
(
i
--
)
{
this
.
items
[
i
]
&&
!
this
.
items
[
i
].
removed
&&
this
.
items
[
i
].
animateWith
(
item
,
anim
);
...
...
raphael.js
View file @
e1fb048f
...
...
@@ -362,7 +362,7 @@
commaSpaces
=
/
\s
*,
\s
*/
,
hsrg
=
{
hs
:
1
,
rg
:
1
},
p2s
=
/,
?([
achlmqrstvxz
])
,
?
/gi
,
pathCommand
=
/
([
achlmqstvz
])[\s
,
]
*
((
-
?\d
*
\.?\d
*
(?:
e
[\-
+
]?\d
+
)?\s
*,
?\s
*
)
+
)
/ig
,
pathCommand
=
/
([
achlm
r
qstvz
])[\s
,
]
*
((
-
?\d
*
\.?\d
*
(?:
e
[\-
+
]?\d
+
)?\s
*,
?\s
*
)
+
)
/ig
,
tCommand
=
/
([
rstm
])[\s
,
]
*
((
-
?\d
*
\.?\d
*
(?:
e
[\-
+
]?\d
+
)?\s
*,
?\s
*
)
+
)
/ig
,
pathValues
=
/
(
-
?\d
*
\.?\d
*
(?:
e
[\-
+
]?\d
+
)?)\s
*,
?\s
*/ig
,
radial_gradient
=
R
.
_radial_gradient
=
/^r
(?:\(([^
,
]
+
?)\s
*,
\s
*
([^\)]
+
?)\))?
/
,
...
...
@@ -884,7 +884,7 @@
if
(
!
pathString
)
{
return
null
;
}
var
paramCounts
=
{
a
:
7
,
c
:
6
,
h
:
1
,
l
:
2
,
m
:
2
,
q
:
4
,
s
:
4
,
t
:
2
,
v
:
1
,
z
:
0
},
var
paramCounts
=
{
a
:
7
,
c
:
6
,
h
:
1
,
l
:
2
,
m
:
2
,
r
:
4
,
q
:
4
,
s
:
4
,
t
:
2
,
v
:
1
,
z
:
0
},
data
=
[];
if
(
R
.
is
(
pathString
,
array
)
&&
R
.
is
(
pathString
[
0
],
array
))
{
// rough assumption
data
=
pathClone
(
pathString
);
...
...
@@ -2559,13 +2559,11 @@
return
color
>
255
?
255
:
color
<
0
?
0
:
color
;
};
elproto
.
animateWith
=
function
(
element
,
params
,
ms
,
easing
,
callback
)
{
// var a = R.animation(params, ms, easing, callback);
// status = element.status(anim);
// this.animate(a);
// this.status(a, status);
this
.
animate
(
params
,
ms
,
easing
,
callback
);
return
this
;
elproto
.
animateWith
=
function
(
element
,
anim
,
params
,
ms
,
easing
,
callback
)
{
var
a
=
params
?
R
.
animation
(
params
,
ms
,
easing
,
callback
)
:
anim
;
status
=
element
.
status
(
anim
);
this
.
animate
(
a
);
return
this
.
status
(
a
,
status
*
anim
.
ms
/
a
.
ms
);
};
function
CubicBezierAtTime
(
t
,
p1x
,
p1y
,
p2x
,
p2y
,
duration
)
{
var
cx
=
3
*
p1x
,
...
...
@@ -2840,13 +2838,16 @@
totalOrigin
:
totalOrigin
};
animationElements
.
push
(
e
);
if
(
status
&&
!
isInAnim
)
{
if
(
status
&&
!
isInAnim
&&
!
isInAnimSet
)
{
e
.
stop
=
true
;
e
.
start
=
new
Date
-
ms
*
status
;
if
(
animationElements
.
length
==
1
)
{
return
animation
();
}
}
if
(
isInAnimSet
)
{
e
.
start
=
new
Date
-
e
.
ms
*
status
;
}
animationElements
.
length
==
1
&&
requestAnimFrame
(
animation
);
}
else
{
isInAnim
.
initstatus
=
status
;
...
...
@@ -2856,6 +2857,9 @@
}
R
.
animation
=
function
(
params
,
ms
,
easing
,
callback
)
{
if
(
params
instanceof
Animation
)
{
return
params
;
}
if
(
R
.
is
(
easing
,
"function"
)
||
!
easing
)
{
callback
=
callback
||
easing
||
null
;
easing
=
null
;
...
...
@@ -2912,7 +2916,10 @@
if
(
anim
)
{
return
e
.
status
;
}
out
.
push
({
anim
:
e
.
anim
,
status
:
e
.
status
});
out
.
push
({
anim
:
e
.
anim
,
status
:
e
.
status
});
}
}
if
(
anim
)
{
...
...
@@ -3078,7 +3085,7 @@
!--
len
&&
callback
.
call
(
set
);
});
easing
=
R
.
is
(
easing
,
string
)
?
easing
:
collector
;
var
anim
=
params
instanceof
Animation
?
params
:
R
.
animation
(
params
,
ms
,
easing
,
collector
);
var
anim
=
R
.
animation
(
params
,
ms
,
easing
,
collector
);
item
=
this
.
items
[
--
i
].
animate
(
anim
);
while
(
i
--
)
{
this
.
items
[
i
]
&&
!
this
.
items
[
i
].
removed
&&
this
.
items
[
i
].
animateWith
(
item
,
anim
);
...
...
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