summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2DlgItemVScr.cpp
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-07-01 02:43:29 +0100
committerAsh Wolf <ninji@wuffs.org>2023-07-01 02:43:29 +0100
commit5c6a48b2ff362a70416a6a00fda7d06e0f276f2d (patch)
tree62cf542c68d91aa6f7a4e3bfa9eddca4ab352970 /src/T2DLL/T2DlgItemVScr.cpp
parentc0c336500955a23e344651e5412c9d9d441ef4ee (diff)
downloadt2win-5c6a48b2ff362a70416a6a00fda7d06e0f276f2d.tar.gz
t2win-5c6a48b2ff362a70416a6a00fda7d06e0f276f2d.zip
i am in hell
Diffstat (limited to 'src/T2DLL/T2DlgItemVScr.cpp')
-rw-r--r--src/T2DLL/T2DlgItemVScr.cpp31
1 files changed, 17 insertions, 14 deletions
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);