From 5c6a48b2ff362a70416a6a00fda7d06e0f276f2d Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Sat, 1 Jul 2023 02:43:29 +0100 Subject: i am in hell --- src/T2DLL/T2DlgItemVScr.cpp | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'src/T2DLL/T2DlgItemVScr.cpp') diff --git a/src/T2DLL/T2DlgItemVScr.cpp b/src/T2DLL/T2DlgItemVScr.cpp index e852793..2dcf999 100644 --- a/src/T2DLL/T2DlgItemVScr.cpp +++ b/src/T2DLL/T2DlgItemVScr.cpp @@ -1,12 +1,19 @@ #include "T2BitImage.h" #include "T2DlgItemVScr.h" +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + T2DlgItemVScr::T2DlgItemVScr(T2TowerDoc* towerDoc, T2ImageObj* imageObj, CPalette* palette) : T2DlgItemScr(towerDoc, imageObj, palette) { } /*virtual*/ BOOL T2DlgItemVScr::OnT2DlgItemEraseBkgnd(CDC* dc) { +#pragma var_order(imgRect, thumbSize, brush, rect, image, destRect, pen1, pen2, savedDC, pen3, thumbPosition) CRect rect; GetClientRect(rect); @@ -40,14 +47,12 @@ T2DlgItemVScr::T2DlgItemVScr(T2TowerDoc* towerDoc, T2ImageObj* imageObj, CPalett int thumbPosition, thumbSize; CalcScrollBarThumb(&thumbPosition, &thumbSize); - int upImg; - if (!IsScrollable()) - upImg = 200; - else - upImg = (mUpImage == 100) ? 100 : 0; - RECT imgRect; - T2BitImage *image = GetObjectImage(imgRect, "DLGITEM:UArrow", upImg); + T2BitImage *image = GetObjectImage( + imgRect, + "DLGITEM:UArrow", + !IsScrollable() ? 200 : (mUpImage == 100) ? 100 : 0 + ); RECT destRect = rect; destRect.top = 0; @@ -55,13 +60,11 @@ T2DlgItemVScr::T2DlgItemVScr(T2TowerDoc* towerDoc, T2ImageObj* imageObj, CPalett dc->Rectangle(&destRect); image->CopyImage(dc, imgRect, destRect, 0, NULL); - int dnImg; - if (!IsScrollable()) - dnImg = 200; - else - dnImg = (mDownImage == 100) ? 100 : 0; - - image = GetObjectImage(imgRect, "DLGITEM:UArrow", dnImg); + image = GetObjectImage( + imgRect, + "DLGITEM:DArrow", + !IsScrollable() ? 200 : (mDownImage == 100) ? 100 : 0 + ); destRect = rect; destRect.top = destRect.bottom - (imgRect.bottom - imgRect.top); -- cgit v1.2.3