[gnome-shell] workspace: Use Util.lerp() instead of own _interpolate()



commit 6ae49092c15c63ccb03ff4bb491c1c2fe0ccf939
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Mon Feb 1 12:08:30 2021 +0100

    workspace: Use Util.lerp() instead of own _interpolate()
    
    Use the utility function we newly introduced instead of having our own
    private _interpolate() in workspace.js.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1617>

 js/ui/workspace.js | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index 383c1e939d..b9f8c27209 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -8,6 +8,7 @@ const DND = imports.ui.dnd;
 const Main = imports.ui.main;
 const Overview = imports.ui.overview;
 const Params = imports.misc.params;
+const Util = imports.misc.util;
 const { WindowPreview } = imports.ui.windowPreview;
 
 var WINDOW_PREVIEW_MAXIMUM_SCALE = 0.95;
@@ -24,10 +25,6 @@ var LAYOUT_SPACE_WEIGHT = 0.1;
 
 var WINDOW_ANIMATION_MAX_NUMBER_BLENDING = 3;
 
-function _interpolate(start, end, step) {
-    return start + (end - start) * step;
-}
-
 // Window Thumbnail Layout Algorithm
 // =================================
 //
@@ -175,7 +172,7 @@ var UnalignedLayoutStrategy = class extends LayoutStrategy {
         // good. We'll use a multiplier of 1.5 for this.
 
         // Map from [0, 1] to [1.5, 1]
-        return _interpolate(1.5, 1, ratio);
+        return Util.lerp(1.5, 1, ratio);
     }
 
     _computeRowSizes(layout) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]