-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: rxvt-unicode-sixel
action: commit
revision:
path_from:
revision_from: 9f0686c8a267896671868c0076fbf2e3f26bf340:
path_to:
revision_to:

git.thebackupbox.net

rxvt-unicode-sixel

git://git.thebackupbox.net/rxvt-unicode-sixel

commit 9f0686c8a267896671868c0076fbf2e3f26bf340
Author: Emanuele Giaquinta <emanuele.giaquinta@gmail.com>
Date:   Thu Apr 12 10:22:50 2012 +0000

    Use lerp in make_align_position and do not change the intervals when
    window_size < image_size.

diff --git a/src/background.C b/src/background.C

index 52ef5644f75336f847709a60a02b847a433506e5..

index ..eccb678466a18c7d1c4453ab1bedd2cf2d56d1e7 100644

--- a/src/background.C
+++ b/src/background.C
@@ -125,15 +125,12 @@ rxvt_term::bg_window_position_sensitive ()
 static inline int
 make_align_position (int align, int window_size, int image_size)
 {
-  int diff = window_size - image_size;
-  int smaller = min (image_size, window_size);
-
   if (align >= 0 && align <= 100)
-    return diff * align / 100;
+    return lerp (0, window_size - image_size, align);
   else if (align > 100)
-    return (align - 100) * smaller / 100 + window_size - smaller;
+    return lerp (window_size - image_size, window_size, align - 100);
   else
-    return (align + 100) * smaller / 100 - image_size;
+    return lerp (-image_size, 0, align + 100);
 }

 static inline int

-----END OF PAGE-----

-- Response ended

-- Page fetched on Sun Jun 2 11:23:40 2024