diff options
author | Ash Wolf <ninji@wuffs.org> | 2023-07-01 02:43:29 +0100 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2023-07-01 02:43:29 +0100 |
commit | 5c6a48b2ff362a70416a6a00fda7d06e0f276f2d (patch) | |
tree | 62cf542c68d91aa6f7a4e3bfa9eddca4ab352970 /src/T2DLL/T2DlgItemScr.cpp | |
parent | c0c336500955a23e344651e5412c9d9d441ef4ee (diff) | |
download | t2win-5c6a48b2ff362a70416a6a00fda7d06e0f276f2d.tar.gz t2win-5c6a48b2ff362a70416a6a00fda7d06e0f276f2d.zip |
i am in hell
Diffstat (limited to '')
-rw-r--r-- | src/T2DLL/T2DlgItemScr.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/T2DLL/T2DlgItemScr.cpp b/src/T2DLL/T2DlgItemScr.cpp index 9f4cb21..46b034f 100644 --- a/src/T2DLL/T2DlgItemScr.cpp +++ b/src/T2DLL/T2DlgItemScr.cpp @@ -83,11 +83,11 @@ T2DlgItemScr::T2DlgItemScr(T2TowerDoc* towerDoc, T2ImageObj* imageObj, CPalette* switch (mClickedArea) { case Area_Thumb: { - int thumbPosition, thumbSize; + int theThumbPosition, theThumbSize; clientRect.DeflateRect(0, 16); - CalcScrollBarThumb(&thumbPosition, &thumbSize); + CalcScrollBarThumb(&theThumbPosition, &theThumbSize); - int val = PositionToValue(clientRect) - thumbSize; + int val = PositionToValue(clientRect) - theThumbSize; if (val == 0) val = 1; @@ -98,24 +98,24 @@ T2DlgItemScr::T2DlgItemScr(T2TowerDoc* towerDoc, T2ImageObj* imageObj, CPalette* break; } case Area_Up: { - CRect upButtonRect; - GetUpButtonRect(clientRect, upButtonRect); - BOOL inUpButton = upButtonRect.PtInRect(pt); - if (inUpButton != m74) { - m74 = inUpButton; + CRect buttonArea; + GetUpButtonRect(clientRect, buttonArea); + BOOL mouseInRect = buttonArea.PtInRect(pt); + if (mouseInRect != m74) { + m74 = mouseInRect; mUpImage = m74 ? 100 : 0; - InvalidateRect(upButtonRect); + InvalidateRect(buttonArea); } break; } case Area_Down: { - CRect downButtonRect; - GetDnButtonRect(clientRect, downButtonRect); - BOOL inDownButton = downButtonRect.PtInRect(pt); - if (inDownButton != m74) { - m74 = inDownButton; + CRect buttonArea; + GetDnButtonRect(clientRect, buttonArea); + BOOL mouseInRect = buttonArea.PtInRect(pt); + if (mouseInRect != m74) { + m74 = mouseInRect; mDownImage = m74 ? 100 : 0; - InvalidateRect(downButtonRect); + InvalidateRect(buttonArea); } break; } @@ -165,12 +165,12 @@ void T2DlgItemScr::ScrollBarAction(int area, int arg) { if (mValue < 0) mValue = 0; - if (mValue > (mRange - mPage)) + if ((mRange - mPage) <= mValue) mValue = mRange - mPage; } + Invalidate(); Notify(GetDlgCtrlID(), 0, &mValue); - Invalidate(); } BOOL T2DlgItemScr::IsScrollable() const { |