Fix rounding error causing transitions not to end.

pull/193/head v5.0.3
Glen Cheney 7 years ago
parent bab773efbf
commit 068c8acf9f

7
dist/shuffle.js vendored

@ -1607,10 +1607,9 @@ var Shuffle = function (_TinyEmitter) {
var styles = Object.assign({}, styleObject);
if (this.options.useTransforms) {
if (this.options.roundTransforms) {
item.point = new Point(Math.round(item.point.x), Math.round(item.point.y));
}
styles.transform = 'translate(' + item.point.x + 'px, ' + item.point.y + 'px) scale(' + item.scale + ')';
var x = this.options.roundTransforms ? Math.round(item.point.x) : item.point.x;
var y = this.options.roundTransforms ? Math.round(item.point.y) : item.point.y;
styles.transform = 'translate(' + x + 'px, ' + y + 'px) scale(' + item.scale + ')';
} else {
styles.left = item.point.x + 'px';
styles.top = item.point.y + 'px';

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,6 +1,7 @@
<h2>Changelog<a href="#changelog"></a></h2>
<p>For a more detailed changelog, visit <a href="https://github.com/Vestride/Shuffle/releases">the latest releases</a> on GitHub.</p>
<ul>
<li><code>v5.0.3</code> 10/30/17 - Fix rounding error.</li>
<li><code>v5.0.2</code> 9/23/17 - Update type definitions. Upgrade dev dependencies.</li>
<li><code>v5.0.1</code> 7/18/17 - Add <code>roundTransforms</code> option.</li>
<li><code>v5.0.0</code> 7/18/17 - Change global export from <code>shuffle</code> to <code>Shuffle</code>. Remove bower support. Expect ES6 environment. Make Shuffle instances Event Emitters instead of dispatching <code>CustomEvent</code>.</li>

@ -1607,10 +1607,9 @@ var Shuffle = function (_TinyEmitter) {
var styles = Object.assign({}, styleObject);
if (this.options.useTransforms) {
if (this.options.roundTransforms) {
item.point = new Point(Math.round(item.point.x), Math.round(item.point.y));
}
styles.transform = 'translate(' + item.point.x + 'px, ' + item.point.y + 'px) scale(' + item.scale + ')';
var x = this.options.roundTransforms ? Math.round(item.point.x) : item.point.x;
var y = this.options.roundTransforms ? Math.round(item.point.y) : item.point.y;
styles.transform = 'translate(' + x + 'px, ' + y + 'px) scale(' + item.scale + ')';
} else {
styles.left = item.point.x + 'px';
styles.top = item.point.y + 'px';

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,6 +1,6 @@
{
"name": "shufflejs",
"version": "5.0.2",
"version": "5.0.3",
"description": "Categorize, sort, and filter a responsive grid of items",
"keywords": [
"gallery",

@ -646,10 +646,9 @@ class Shuffle extends TinyEmitter {
const styles = Object.assign({}, styleObject);
if (this.options.useTransforms) {
if (this.options.roundTransforms) {
item.point = new Point(Math.round(item.point.x), Math.round(item.point.y));
}
styles.transform = `translate(${item.point.x}px, ${item.point.y}px) scale(${item.scale})`;
const x = this.options.roundTransforms ? Math.round(item.point.x) : item.point.x;
const y = this.options.roundTransforms ? Math.round(item.point.y) : item.point.y;
styles.transform = `translate(${x}px, ${y}px) scale(${item.scale})`;
} else {
styles.left = item.point.x + 'px';
styles.top = item.point.y + 'px';

Loading…
Cancel
Save