This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository legacy-imlib2.

View the commit online.

commit 40c78f5112df36b12c92ce5ba4f924982981fc2c
Author: Kim Woelders <k...@woelders.dk>
AuthorDate: Thu Apr 3 19:38:42 2025 +0200

    blend: Fixup after "blend: Rename some variables for clarity"
    
    https://git.enlightenment.org/old/legacy-imlib2/issues/32
---
 src/lib/blend.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/lib/blend.c b/src/lib/blend.c
index 7a2be4d..637530d 100644
--- a/src/lib/blend.c
+++ b/src/lib/blend.c
@@ -1852,10 +1852,12 @@ __imlib_BlendImageToImage(const ImlibImage *im_src, ImlibImage *im_dst,
     {
         ImlibScaleInfo *scaleinfo;
         uint32_t       *buf;
-        int             dwabs, dhabs, dxx, dyy, y2, x2;
+        int             dwabs, dhabs, dxx, dyy, y2, x2, sw_org, sh_org;
         int             psx, psy, psw, psh;
         int             y, h, hh;
 
+        sw_org = sw;
+        sh_org = sh;
         dwabs = abs(dw);
         dhabs = abs(dh);
 
@@ -1868,9 +1870,9 @@ __imlib_BlendImageToImage(const ImlibImage *im_src, ImlibImage *im_dst,
         if (sw <= 0 || sh <= 0)
             return;
         if (psx != sx)
-            dx += ((sx - psx) * dwabs) / sw;
+            dx += ((sx - psx) * dwabs) / psw;
         if (psy != sy)
-            dy += ((sy - psy) * dhabs) / sh;
+            dy += ((sy - psy) * dhabs) / psh;
         if (psw != sw)
             dwabs = (dwabs * sw) / psw;
         if (psh != sh)
@@ -1900,8 +1902,8 @@ __imlib_BlendImageToImage(const ImlibImage *im_src, ImlibImage *im_dst,
             sh = (sh * dhabs) / psh;
         dxx = dx - psx;
         dyy = dy - psy;
-        dxx += (x2 * abs(dw)) / sw;
-        dyy += (y2 * abs(dh)) / sh;
+        dxx += (x2 * dwabs) / sw_org;
+        dyy += (y2 * dhabs) / sh_org;
 
         if (sw == 0)
             sw = 1;
@@ -1913,7 +1915,7 @@ __imlib_BlendImageToImage(const ImlibImage *im_src, ImlibImage *im_dst,
         if (sw <= 0 || sh <= 0)
             return;
 
-        scaleinfo = __imlib_CalcScaleInfo(im_src, sw, sh, dw, dh, aa);
+        scaleinfo = __imlib_CalcScaleInfo(im_src, sw_org, sh_org, dw, dh, aa);
         if (!scaleinfo)
             return;
         /* if we are scaling the image at all make a scaling buffer */

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to