From 9c39b4ad7aff1e0752e03d7d3db4e01576e2d406 Mon Sep 17 00:00:00 2001 From: David Capello Date: Fri, 26 May 2017 15:13:26 -0300 Subject: [PATCH] Use full color range from [0,0xffff] in gradients --- src/app/tools/ink_processing.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/app/tools/ink_processing.h b/src/app/tools/ink_processing.h index f974b660a..e76982b3a 100644 --- a/src/app/tools/ink_processing.h +++ b/src/app/tools/ink_processing.h @@ -918,16 +918,16 @@ public: } stops[0].x = pixman_int_to_fixed(0); - stops[0].color.red = int(doc::rgba_getr(c0)) << 8; - stops[0].color.green = int(doc::rgba_getg(c0)) << 8; - stops[0].color.blue = int(doc::rgba_getb(c0)) << 8; - stops[0].color.alpha = int(doc::rgba_geta(c0)) << 8; + stops[0].color.red = 0xffff * int(doc::rgba_getr(c0)) / 255; + stops[0].color.green = 0xffff * int(doc::rgba_getg(c0)) / 255; + stops[0].color.blue = 0xffff * int(doc::rgba_getb(c0)) / 255; + stops[0].color.alpha = 0xffff * int(doc::rgba_geta(c0)) / 255; stops[1].x = pixman_int_to_fixed(1); - stops[1].color.red = int(doc::rgba_getr(c1)) << 8; - stops[1].color.green = int(doc::rgba_getg(c1)) << 8; - stops[1].color.blue = int(doc::rgba_getb(c1)) << 8; - stops[1].color.alpha = int(doc::rgba_geta(c1)) << 8; + stops[1].color.red = 0xffff * int(doc::rgba_getr(c1)) / 255; + stops[1].color.green = 0xffff * int(doc::rgba_getg(c1)) / 255; + stops[1].color.blue = 0xffff * int(doc::rgba_getb(c1)) / 255; + stops[1].color.alpha = 0xffff * int(doc::rgba_geta(c1)) / 255; pixman_image_t* gradientImg = pixman_image_create_linear_gradient(