From 6ef3a8f059a1394a6dedee368dac7eb24a8e39bc Mon Sep 17 00:00:00 2001 From: Yauhen Kirylau Date: Sun, 28 Mar 2021 08:48:48 +0200 Subject: [PATCH] fix(gears: colors: recolor_image): always duplicate the surface (#3233) --- lib/gears/color.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/gears/color.lua b/lib/gears/color.lua index 0e1d9be48..873c513a2 100644 --- a/lib/gears/color.lua +++ b/lib/gears/color.lua @@ -341,9 +341,7 @@ end -- @return Recolored image. -- @staticfct gears.color.recolor_image function color.recolor_image(image, new_color) - if type(image) == 'string' then - image = surface.duplicate_surface(image) - end + image = surface.duplicate_surface(image) local cr = cairo.Context.create(image) cr:set_source(color.create_pattern(new_color)) cr:mask(cairo.Pattern.create_for_surface(image), 0, 0)