From d94be8af2af442f5621f1554be48b1272dea0f41 Mon Sep 17 00:00:00 2001 From: justin1014 Date: Sat, 21 Sep 2002 03:21:22 +0000 Subject: [PATCH] 2 byte reduction yay git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1103 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/bgbg.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/exehead/bgbg.c b/Source/exehead/bgbg.c index 26a454a1..636f1329 100644 --- a/Source/exehead/bgbg.c +++ b/Source/exehead/bgbg.c @@ -26,9 +26,10 @@ static LRESULT CALLBACK BG_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l int rv,gv,bv; RECT rect; HBRUSH brush; - rv = (GetRValue(m_color2) * y + GetRValue(m_color1) * (r.bottom - y)) / r.bottom; - gv = (GetGValue(m_color2) * y + GetGValue(m_color1) * (r.bottom - y)) / r.bottom; - bv = (GetBValue(m_color2) * y + GetBValue(m_color1) * (r.bottom - y)) / r.bottom; + int ry=r.bottom-y; + rv = (GetRValue(m_color2) * y + GetRValue(m_color1) * ry) / r.bottom; + gv = (GetGValue(m_color2) * y + GetGValue(m_color1) * ry) / r.bottom; + bv = (GetBValue(m_color2) * y + GetBValue(m_color1) * ry) / r.bottom; brush = CreateSolidBrush(RGB(rv,gv,bv)); SetRect(&rect, r.left, y, r.right, y+4); // note that we don't need to do "SelectObject(hdc, brush)"