Skip to content

Commit d522110

Browse files
committed
Start swipes closer to where animation has taken the transition.
1 parent 5725879 commit d522110

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/switcher.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export class Switcher {
5757
this._windows = [...windows];
5858
this._modifierMask = null;
5959
this._currentIndex = currentIndex;
60+
this._lastIndex = currentIndex;
6061
this._haveModal = false;
6162
this._tracker = manager.platform.getWindowTracker();
6263
this._windowManager = global.window_manager;
@@ -251,7 +252,8 @@ export class Switcher {
251252

252253
_gestureBegin(tracker) {
253254
const baseDistance = 400;
254-
const progress = this._currentIndex;
255+
let t = this._previews[this._currentIndex].get_transition('scale-x');
256+
const progress = t !== null ? (this._currentIndex - this._lastIndex) * t.get_progress() + this._lastIndex : this._currentIndex;//this._currentIndex;
255257
const points = [];
256258
for (let i = 0; i < this._previews.length; i++) {
257259
points.push(i);
@@ -522,6 +524,7 @@ export class Switcher {
522524
}
523525

524526
_setCurrentIndex(value) {
527+
this._lastIndex = this._currentIndex;
525528
this._currentIndex = value;
526529
}
527530

0 commit comments

Comments
 (0)