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 a4e240bc9601258f6e11345b44d75364e14c7ce8
Author: Kim Woelders <k...@woelders.dk>
AuthorDate: Fri Jan 13 08:32:39 2023 +0100
api: Fix code duplication around some __imlib_BlendImageToImage() calls
---
src/lib/api.c | 53 +++++++++++++++++------------------------------------
1 file changed, 17 insertions(+), 36 deletions(-)
diff --git a/src/lib/api.c b/src/lib/api.c
index 9409c61..3403f94 100644
--- a/src/lib/api.c
+++ b/src/lib/api.c
@@ -1047,23 +1047,14 @@ imlib_create_cropped_image(int x, int y, int width, int height)
__imlib_FreeImage(im);
return NULL;
}
- if (im_old->has_alpha)
- {
- im->has_alpha = 1;
- __imlib_BlendImageToImage(im_old, im, 0, 0, 1, x, y, abs(width),
- abs(height), 0, 0, width, height, NULL,
- (ImlibOp) IMLIB_OP_COPY,
- ctx->cliprect.x, ctx->cliprect.y,
- ctx->cliprect.w, ctx->cliprect.h);
- }
- else
- {
- __imlib_BlendImageToImage(im_old, im, 0, 0, 0, x, y, abs(width),
- abs(height), 0, 0, width, height, NULL,
- (ImlibOp) IMLIB_OP_COPY,
- ctx->cliprect.x, ctx->cliprect.y,
- ctx->cliprect.w, ctx->cliprect.h);
- }
+
+ im->has_alpha = im_old->has_alpha;
+ __imlib_BlendImageToImage(im_old, im, 0, 0, im->has_alpha,
+ x, y, abs(width), abs(height), 0, 0, width, height,
+ NULL, (ImlibOp) IMLIB_OP_COPY,
+ ctx->cliprect.x, ctx->cliprect.y,
+ ctx->cliprect.w, ctx->cliprect.h);
+
return im;
}
@@ -1089,25 +1080,15 @@ imlib_create_cropped_scaled_image(int source_x, int source_y,
__imlib_FreeImage(im);
return NULL;
}
- if (im_old->has_alpha)
- {
- im->has_alpha = 1;
- __imlib_BlendImageToImage(im_old, im, ctx->anti_alias, 0, 1, source_x,
- source_y, source_width, source_height, 0, 0,
- destination_width, destination_height, NULL,
- (ImlibOp) IMLIB_OP_COPY,
- ctx->cliprect.x, ctx->cliprect.y,
- ctx->cliprect.w, ctx->cliprect.h);
- }
- else
- {
- __imlib_BlendImageToImage(im_old, im, ctx->anti_alias, 0, 0, source_x,
- source_y, source_width, source_height, 0, 0,
- destination_width, destination_height, NULL,
- (ImlibOp) IMLIB_OP_COPY,
- ctx->cliprect.x, ctx->cliprect.y,
- ctx->cliprect.w, ctx->cliprect.h);
- }
+
+ im->has_alpha = im_old->has_alpha;
+ __imlib_BlendImageToImage(im_old, im, ctx->anti_alias, 0, im->has_alpha,
+ source_x, source_y, source_width, source_height,
+ 0, 0, destination_width, destination_height,
+ NULL, (ImlibOp) IMLIB_OP_COPY,
+ ctx->cliprect.x, ctx->cliprect.y,
+ ctx->cliprect.w, ctx->cliprect.h);
+
return im;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.