Skip to content

Commit

Permalink
3.7.1
Browse files Browse the repository at this point in the history
- IMPROVED: made the "wheel" event listener passive in ScrollTrigger. See #460

- IMPROVED: made it possible to use CustomEase without loading GSAP.

- IMPROVED: function-based inertia "end" values now receive the velocity as the 2nd parameter which makes it much easier to do directional snapping

- IMPROVED: if you alter the repeatDelay() after the animation has already started, it maintains the playhead's local position as long as the parent timeline has smoothChildTiming enabled.

- FIXED: if you call .update() with the "sticky" parameter true while dragging after the element has been changed in the document flow (repositioned), it may render at the incorrect position.

- FIXED: if you kill() a ScrollTrigger instance, the previous scroll position may still be remembered. So, for example, in a SPA that goes to a new page and kills all the ScrollTriggers, it may still keep the scroll position instead of going back to the top/left. See https://greensock.com/forums/topic/28592-scrolltrigger-and-nextjs-scroll-position-after-route-change/ and https://greensock.com/forums/topic/28575-scrolltrigger-issue-with-scroll-position-when-i-navigate-to-a-page/

- FIXED: if ScrollTrigger.update() was called during a ScrollTrigger.refresh(), it could cause pinned elements not to be positioned correctly. See https://greensock.com/forums/topic/28547-having-an-issue-with-scrolltrigger-locomotive-scroll/

- FIXED: worked around a Firefox bug that could throw an error if you tried to Flip a root <svg> element. Firefox reports getCTM() as null on <svg> elements.

- FIXED: improved Flip plugin's ability to correctly size root <svg> elements

- FIXED: regression in 3.7.0 caused a tween's onStart callback to be called twice. See https://greensock.com/forums/topic/28644-370-onstart-in-fromto-fires-twice/

- FIXED: if you define a "snap" value for ScrollTrigger as an Array in the shorthand syntax, like snap: [0, 0.1, 0.7, 1] instead of snap: {snapTo: [0, 0.1, 0.7, 1]}, it didn't work properly.

- FIXED: if you resume a tween whose playhead is at the VERY end, it could render one last time unnecessarily, calling the onComplete when it really shouldn't because the playhead didn't move.

- FIXED: regression in GSDevTools.create() caused it not to display all animations with "id" properties in the drop-down list. See https://greensock.com/forums/topic/28706-gsdevtools-animation-ids-not-working/

- FIXED: an edge case could cause MotionPathPlugin could use a large amount of memory. See https://greensock.com/forums/topic/28744-multiple-gsap-motion-path-traces-on-the-same-timeline-simultaneously/
  • Loading branch information
jackdoyle committed Jul 15, 2021
1 parent 41bb349 commit 4d47e0a
Show file tree
Hide file tree
Showing 60 changed files with 511 additions and 263 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ View the <a href="https://greensock.com/docs">full documentation here</a>, inclu

### CDN
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.7.0/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.7.1/gsap.min.js"></script>
```
Click the green "Get GSAP Now" button at <a href="https://greensock.com/?download=GSAP-JS">greensock.com</a> for more options and installation instructions, including CDN URLs for various plugins.

Expand Down
4 changes: 2 additions & 2 deletions dist/CSSRulePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
}(this, (function (exports) { 'use strict';

/*!
* CSSRulePlugin 3.7.0
* CSSRulePlugin 3.7.1
* https://greensock.com
*
* @license Copyright 2008-2021, GreenSock. All rights reserved.
Expand Down Expand Up @@ -51,7 +51,7 @@
};

var CSSRulePlugin = {
version: "3.7.0",
version: "3.7.1",
name: "cssRule",
init: function init(target, value, tween, index, targets) {
if (!_checkRegister() || typeof target.cssText === "undefined") {
Expand Down
4 changes: 2 additions & 2 deletions dist/CSSRulePlugin.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/CSSRulePlugin.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 49 additions & 14 deletions dist/Draggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
_divContainer,
_svgContainer,
_identityMatrix,
_gEl,
_transformProp = "transform",
_transformOriginProp = _transformProp + "Origin",
_hasOffsetBug,
Expand All @@ -45,6 +46,8 @@
_doc = doc;
_docElement = doc.documentElement;
_body = doc.body;
_gEl = _doc.createElementNS("http://www.w3.org/2000/svg", "g");
_gEl.style.transform = "none";
var d1 = doc.createElement("div"),
d2 = doc.createElement("div");

Expand Down Expand Up @@ -144,6 +147,21 @@
}

return c;
},
_getCTM = function _getCTM(svg) {
var m = svg.getCTM(),
transform;

if (!m) {
transform = svg.style[_transformProp];
svg.style[_transformProp] = "none";
svg.appendChild(_gEl);
m = _gEl.getCTM();
svg.removeChild(_gEl);
transform ? svg.style[_transformProp] = transform : svg.style.removeProperty(_transformProp.replace(/([A-Z])/g, "-$1").toLowerCase());
}

return m;
},
_placeSiblings = function _placeSiblings(element, adjustGOffset) {
var svg = _svgOwner(element),
Expand All @@ -165,20 +183,17 @@
container = svg ? _svgContainer : _divContainer;

if (svg) {
b = isRootSVG ? {
x: 0,
y: 0
} : element.getBBox();
m = element.transform ? element.transform.baseVal : {};

if (m.numberOfItems) {
m = m.numberOfItems > 1 ? _consolidate(m) : m.getItem(0).matrix;
if (isRootSVG) {
b = _getCTM(element);
x = -b.e / b.a;
y = -b.f / b.d;
m = _identityMatrix;
} else {
b = element.getBBox();
m = element.transform ? element.transform.baseVal : {};
m = !m.numberOfItems ? _identityMatrix : m.numberOfItems > 1 ? _consolidate(m) : m.getItem(0).matrix;
x = m.a * b.x + m.c * b.y;
y = m.b * b.x + m.d * b.y;
} else {
m = _identityMatrix;
x = b.x;
y = b.y;
}

if (adjustGOffset && element.tagName.toLowerCase() === "g") {
Expand All @@ -205,7 +220,7 @@

cs = _win.getComputedStyle(element);

if (cs.position !== "absolute") {
if (cs.position !== "absolute" && cs.position !== "fixed") {
m = element.offsetParent;

while (parent && parent !== m) {
Expand Down Expand Up @@ -1306,6 +1321,7 @@
clickDispatch,
trustedClickDispatch,
isPreventingDefault,
innerMatrix,
onContextMenu = function onContextMenu(e) {
_preventDefault(e);

Expand Down Expand Up @@ -1839,6 +1855,8 @@
render(true);
}

innerMatrix = getGlobalMatrix(target);

if (scrollProxy) {
calculateBounds();
startElementY = scrollProxy.top();
Expand Down Expand Up @@ -2609,6 +2627,23 @@
};

_this2.update = function (applyBounds, sticky, ignoreExternalChanges) {
if (sticky && self.isPressed) {
var m = getGlobalMatrix(target),
p = innerMatrix.apply({
x: self.x - startElementX,
y: self.y - startElementY
}),
m2 = getGlobalMatrix(target.parentNode, true);
m2.apply({
x: m.e - p.x,
y: m.f - p.y
}, p);
self.x -= p.x - m2.e;
self.y -= p.y - m2.f;
render(true);
recordStartPositions();
}

var x = self.x,
y = self.y;
updateMatrix(!sticky);
Expand Down Expand Up @@ -2888,7 +2923,7 @@
});

Draggable.zIndex = 1000;
Draggable.version = "3.7.0";
Draggable.version = "3.7.1";
_getGSAP() && gsap.registerPlugin(Draggable);

exports.Draggable = Draggable;
Expand Down
4 changes: 2 additions & 2 deletions dist/Draggable.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/Draggable.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/EasePack.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
}(this, (function (exports) { 'use strict';

/*!
* EasePack 3.7.0
* EasePack 3.7.1
* https://greensock.com
*
* @license Copyright 2008-2021, GreenSock. All rights reserved.
Expand Down Expand Up @@ -201,7 +201,7 @@

for (var p in EasePack) {
EasePack[p].register = _initCore;
EasePack[p].version = "3.7.0";
EasePack[p].version = "3.7.1";
}

_getGSAP() && gsap.registerPlugin(SlowMo);
Expand Down
Loading

0 comments on commit 4d47e0a

Please sign in to comment.