From e5d4d91871cbf80ecece669e2ba7b9ded00176aa Mon Sep 17 00:00:00 2001 From: Alex Henrie Date: Thu, 29 Oct 2015 21:30:22 -0600 Subject: [PATCH] winex11: Make color cubes as big as possible. Signed-off-by: Alex Henrie Signed-off-by: Alexandre Julliard --- dlls/winex11.drv/palette.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/winex11.drv/palette.c b/dlls/winex11.drv/palette.c index 953c9ea2438..f9503349daf 100644 --- a/dlls/winex11.drv/palette.c +++ b/dlls/winex11.drv/palette.c @@ -594,10 +594,10 @@ static void X11DRV_PALETTE_FillDefaultColors( const PALETTEENTRY *sys_pal_templa if (palette_size <= NB_RESERVED_COLORS) return; - while (i*i*i < (palette_size - NB_RESERVED_COLORS)) i++; + while (i*i*i <= (palette_size - NB_RESERVED_COLORS)) i++; no_r = no_g = no_b = --i; - if ((no_r * (no_g+1) * no_b) < (palette_size - NB_RESERVED_COLORS)) no_g++; - if ((no_r * no_g * (no_b+1)) < (palette_size - NB_RESERVED_COLORS)) no_b++; + if ((no_r * (no_g+1) * no_b) <= (palette_size - NB_RESERVED_COLORS)) no_g++; + if ((no_r * no_g * (no_b+1)) <= (palette_size - NB_RESERVED_COLORS)) no_b++; inc_r = (255 - NB_COLORCUBE_START_INDEX)/no_r; inc_g = (255 - NB_COLORCUBE_START_INDEX)/no_g; inc_b = (255 - NB_COLORCUBE_START_INDEX)/no_b; -- 2.11.4.GIT