add the Quad easing methods for Tween
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6415 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -268,3 +268,51 @@ OpenLayers.Easing.Expo = {
|
|||||||
|
|
||||||
CLASS_NAME: "OpenLayers.Easing.Expo"
|
CLASS_NAME: "OpenLayers.Easing.Expo"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Namespace: OpenLayers.Easing.Quad
|
||||||
|
*/
|
||||||
|
OpenLayers.Easing.Quad = {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function: easeIn
|
||||||
|
*
|
||||||
|
* Parameters:
|
||||||
|
* t - {Float} time
|
||||||
|
* b - {Float} beginning position
|
||||||
|
* c - {Float} total change
|
||||||
|
* d - {Float} duration of the transition
|
||||||
|
*/
|
||||||
|
easeIn: function(t, b, c, d) {
|
||||||
|
return c*(t/=d)*t + b;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function: easeOut
|
||||||
|
*
|
||||||
|
* Parameters:
|
||||||
|
* t - {Float} time
|
||||||
|
* b - {Float} beginning position
|
||||||
|
* c - {Float} total change
|
||||||
|
* d - {Float} duration of the transition
|
||||||
|
*/
|
||||||
|
easeOut: function(t, b, c, d) {
|
||||||
|
return -c *(t/=d)*(t-2) + b;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function: easeInOut
|
||||||
|
*
|
||||||
|
* Parameters:
|
||||||
|
* t - {Float} time
|
||||||
|
* b - {Float} beginning position
|
||||||
|
* c - {Float} total change
|
||||||
|
* d - {Float} duration of the transition
|
||||||
|
*/
|
||||||
|
easeInOut: function(t, b, c, d) {
|
||||||
|
if ((t/=d/2) < 1) return c/2*t*t + b;
|
||||||
|
return -c/2 * ((--t)*(t-2) - 1) + b;
|
||||||
|
},
|
||||||
|
|
||||||
|
CLASS_NAME: "OpenLayers.Easing.Quad"
|
||||||
|
};
|
||||||
|
|||||||
@@ -65,6 +65,7 @@
|
|||||||
<select name="transition" id="transition" onchange="changeTween()">
|
<select name="transition" id="transition" onchange="changeTween()">
|
||||||
<option value="Linear">Linear</option>
|
<option value="Linear">Linear</option>
|
||||||
<option value="Expo">Expo</option>
|
<option value="Expo">Expo</option>
|
||||||
|
<option value="Quad">Quad</option>
|
||||||
</select>
|
</select>
|
||||||
<select name="easing" id="easing" onchange="changeTween()">
|
<select name="easing" id="easing" onchange="changeTween()">
|
||||||
<option value="easeIn">EaseIn</option>
|
<option value="easeIn">EaseIn</option>
|
||||||
|
|||||||
Reference in New Issue
Block a user