mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
Fixed force multiplyer to take into account sidebar width instead of scroll width
This commit is contained in:
@@ -394,10 +394,10 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
event.stopPropagation();
|
||||
|
||||
const delta = event.delta * 300 + 1;
|
||||
const stripWidth = document.getElementById('tabbrowser-tabs').scrollWidth;
|
||||
const stripWidth = document.getElementById('tabbrowser-tabs').getBoundingClientRect().width;
|
||||
let translateX = this._swipeState.lastDelta + delta;
|
||||
// Add a force multiplier as we are translating the strip depending on how close to the edge we are
|
||||
let forceMultiplier = Math.min(1, 1 - Math.abs(translateX) / (stripWidth * 1.5));
|
||||
let forceMultiplier = Math.min(1, 1 - Math.abs(translateX) / (stripWidth * 4.5)); // 4.5 instead of 4 to add a bit of a buffer
|
||||
if (forceMultiplier > 0.5) {
|
||||
translateX *= forceMultiplier;
|
||||
this._swipeState.lastDelta = delta;
|
||||
|
Reference in New Issue
Block a user