Skip to content

Commit

Permalink
Fixed bug in manual mode with easings
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-lundin committed May 19, 2015
1 parent d8811a5 commit 55fcfe5
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 10 deletions.
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -14,6 +14,9 @@ Fast animations with Javascript and CSS transforms(Work in progress)
## Releases
The initial release is out. Would love some feedback on things that can be improved. The release(and future ones) can be found in the release section

- **0.5.3** - Bugfix for manual mode with easings
- **0.5.2** - Compability fixes, polyfill for request animation frame
- **0.5.1** - Performance improvements
- **0.5.0** - Refactoring, show deprecation warnings
- **0.4.0** - Manual mode, function initalizers
- **0.3.0** - Memory optimizations, improved Matrix API, better UMD wrappers
Expand Down
2 changes: 1 addition & 1 deletion bower.json
@@ -1,7 +1,7 @@
{
"name": "snabbt.js",
"main": "snabbt.min.js",
"version": "0.5.2",
"version": "0.5.3",
"authors": [
"daniel-lundin <daniel.t.lundin@gmail.com>"
],
Expand Down
1 change: 1 addition & 0 deletions docs/docs.js
Expand Up @@ -157,6 +157,7 @@ $(function() {
perspective: 400,
});
});

// Transform origin example
$("#transform-origin-example-2").on('click', function() {
var elementWidth = $("#transform-origin-example-2").outerWidth();
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Expand Up @@ -252,7 +252,7 @@ <h3>Transform origin</h3>
<p>By default, rotations are applied around the center of the element. By using <em>transformOrigin</em> rotations can be performed around abritary positions.</p>
<pre><code class="javascript">snabbt(element, {
rotation: [0, 2*Math.PI, 0],
transformOrigin: [element.clientWidth, 0, 0]
transformOrigin: [element.clientWidth/2, 0, 0]
});</code></pre>
<button id='transform-origin-example' class="button-primary extra-top-margin">Run example</button>
<div>
Expand Down
4 changes: 2 additions & 2 deletions docs/snabbt.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "snabbt.js",
"version": "0.5.2",
"version": "0.5.3",
"description": "Fast animations with javascript and CSS-transforms",
"main": "snabbt.min.js",
"files": [
Expand Down
9 changes: 6 additions & 3 deletions snabbt.js
Expand Up @@ -458,8 +458,8 @@
tick: function(time) {
if(stopped)
return;
if(manual) {

if(manual) {
currentTime = time;
this.updateCurrentTransform();
return;
Expand Down Expand Up @@ -493,8 +493,11 @@

updateCurrentTransform: function() {
var tweenValue = easing.getValue();
if(manual)
tweenValue = Math.max(0.00001, manualValue - manualDelayFactor);
if(manual) {
var val = Math.max(0.00001, manualValue - manualDelayFactor);
easing.tick(val);
tweenValue = easing.getValue();
}
tweener.tween(tweenValue);
},

Expand Down
4 changes: 2 additions & 2 deletions snabbt.min.js

Large diffs are not rendered by default.

0 comments on commit 55fcfe5

Please sign in to comment.