Merge pull request #2562 from kwagyeman/kwabena/gpu_scaling_fix

imlib/draw: Simplify GPU source rect calculation.
This commit is contained in:
Ibrahim Abdelkader 2024-12-27 09:18:10 +02:00 committed by GitHub
commit 482e7d389a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3043,10 +3043,10 @@ void imlib_draw_image(image_t *dst_img,
};
rectangle_t src_rect = {
.x = src_x_accum_reset >> 16,
.y = src_y_accum_reset >> 16,
.w = ((src_x_accum_reset + (src_x_frac * dst_rect.w)) >> 16) - src_rect.x,
.h = ((src_y_accum_reset + (src_y_frac * dst_rect.h)) >> 16) - src_rect.y,
.x = fast_roundf(src_x_start / x_scale),
.y = fast_roundf(src_y_start / y_scale),
.w = fast_floorf(dst_rect.w / x_scale),
.h = fast_floorf(dst_rect.h / y_scale),
};
image_hint_t gpu_hints = ((dst_delta_x < 0) ? IMAGE_HINT_HMIRROR : 0) |