From 9a5403580fcdab0838c951ef597ec2e6b7c59567 Mon Sep 17 00:00:00 2001 From: Eugene Ingerman Date: Fri, 24 Jan 2003 09:11:03 +0000 Subject: [PATCH] Fixed a shameful bug. Color translation should work now. svn path=/trunk/; revision=4056 --- reactos/subsys/win32k/eng/xlate.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/reactos/subsys/win32k/eng/xlate.c b/reactos/subsys/win32k/eng/xlate.c index 72f8328bde7..da8377693a2 100644 --- a/reactos/subsys/win32k/eng/xlate.c +++ b/reactos/subsys/win32k/eng/xlate.c @@ -58,9 +58,12 @@ ULONG ClosestColorMatch(ULONG SourceColor, ULONG *DestColors, { cDestColors = (PVIDEO_CLUTDATA)&DestColors[i]; - cxRed = (cSourceColor->Red - cDestColors->Red) ^ 2; - cxGreen = (cSourceColor->Green - cDestColors->Green) ^ 2; - cxBlue = (cSourceColor->Blue - cDestColors->Blue) ^ 2; + cxRed = (cSourceColor->Red - cDestColors->Red); + cxRed *= cxRed; //compute cxRed squared + cxGreen = (cSourceColor->Green - cDestColors->Green); + cxGreen *= cxGreen; + cxBlue = (cSourceColor->Blue - cDestColors->Blue); + cxBlue *= cxBlue; rt = /* sqrt */ (cxRed + cxGreen + cxBlue);