From 0dc9425b60ee03dbfb8e35a145d11abeddaab4ce Mon Sep 17 00:00:00 2001 From: sunghyun kim Date: Tue, 16 Jul 2024 13:55:19 +0900 Subject: [PATCH] [Tizen] Add patch for CUSTOM_SCALING_FACTOR so that it can be used without limitation Change-Id: If144273142f00c047821e1ea0fc236e2c48fa281 --- src/cairo-image-surface.c | 50 +++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c index 7a79896c7..76dfa22ba 100644 --- a/src/cairo-image-surface.c +++ b/src/cairo-image-surface.c @@ -1409,35 +1409,45 @@ _cairo_image_surface_shadow_surface (void *surface, if (width < MIN_IMAGE_SHADOW_SIZE) shadow_width = width; else if (has_blur) { - if (width < MIN_IMAGE_SHADOW_SIZE * 2) - shadow_width = MIN_IMAGE_SHADOW_SIZE; - else if (width > MAX_IMAGE_SHADOW_SIZE * 2) - shadow_width = MAX_IMAGE_SHADOW_SIZE; - else - shadow_width = width * shadow_scaling_factor; + if(shadow_scaling_factor != 0.5f){ + shadow_width = width * shadow_scaling_factor; + } + else{ + if (width < MIN_IMAGE_SHADOW_SIZE * 2) + shadow_width = MIN_IMAGE_SHADOW_SIZE; + else if (width > MAX_IMAGE_SHADOW_SIZE * 2) + shadow_width = MAX_IMAGE_SHADOW_SIZE; + else + shadow_width = width * shadow_scaling_factor; + } } else { - if (width > MAX_IMAGE_SHADOW_SIZE) - shadow_width = MAX_IMAGE_SHADOW_SIZE; - else - shadow_width = width; + if (width > MAX_IMAGE_SHADOW_SIZE) + shadow_width = MAX_IMAGE_SHADOW_SIZE; + else + shadow_width = width; } if (height < MIN_IMAGE_SHADOW_SIZE) shadow_height = height; else if (has_blur) { - if (height < MIN_IMAGE_SHADOW_SIZE * 2) - shadow_height = MIN_IMAGE_SHADOW_SIZE; - else if (height > MAX_IMAGE_SHADOW_SIZE * 2) - shadow_height = MAX_IMAGE_SHADOW_SIZE; - else - shadow_height = height * shadow_scaling_factor; + if(shadow_scaling_factor != 0.5f){ + shadow_height = height * shadow_scaling_factor; + } + else{ + if (height < MIN_IMAGE_SHADOW_SIZE * 2) + shadow_height = MIN_IMAGE_SHADOW_SIZE; + else if (height > MAX_IMAGE_SHADOW_SIZE * 2) + shadow_height = MAX_IMAGE_SHADOW_SIZE; + else + shadow_height = height * shadow_scaling_factor; + } } else { - if (height > MAX_IMAGE_SHADOW_SIZE) - shadow_height = MAX_IMAGE_SHADOW_SIZE; - else - shadow_height = height; + if (height > MAX_IMAGE_SHADOW_SIZE) + shadow_height = MAX_IMAGE_SHADOW_SIZE; + else + shadow_height = height; } shadow_surface = (cairo_image_surface_t *) -- 2.34.1