From 78679ca221361223fde9ec1460d29757de544abb Mon Sep 17 00:00:00 2001 From: cxl Date: Mon, 23 Dec 2013 13:34:49 +0000 Subject: [PATCH] Painter: Fixed rounding issue for alpha git-svn-id: svn://ultimatepp.org/upp/trunk@6692 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Painter/BufferPainter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uppsrc/Painter/BufferPainter.h b/uppsrc/Painter/BufferPainter.h index dd92871f5..d5cf050be 100644 --- a/uppsrc/Painter/BufferPainter.h +++ b/uppsrc/Painter/BufferPainter.h @@ -93,7 +93,7 @@ inline void AlphaBlend(RGBA& t, const RGBA& c) t.r = c.r + (alpha * t.r >> 8); t.g = c.g + (alpha * t.g >> 8); t.b = c.b + (alpha * t.b >> 8); - t.a = c.a + (alpha * t.a >> 8); + t.a = c.a + ((256 - c.a) * t.a >> 8); } inline void AlphaBlendCover8(RGBA& t, const RGBA& c, int cover)