diff options
Diffstat (limited to 'src/T2DLL/T2DlgItemScr.cpp')
-rw-r--r-- | src/T2DLL/T2DlgItemScr.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/T2DLL/T2DlgItemScr.cpp b/src/T2DLL/T2DlgItemScr.cpp index 692c9a6..9f4cb21 100644 --- a/src/T2DLL/T2DlgItemScr.cpp +++ b/src/T2DLL/T2DlgItemScr.cpp @@ -48,7 +48,7 @@ T2DlgItemScr::T2DlgItemScr(T2TowerDoc* towerDoc, T2ImageObj* imageObj, CPalette* mClickedArea = ScrollBarHittest(pt); if (mClickedArea != 0) { - if (mClickedArea == Area_SetAbsolute) { + if (mClickedArea == Area_Thumb) { mMouseDownPoint = pt; mMouseDownValue = mValue; } else { @@ -82,17 +82,17 @@ T2DlgItemScr::T2DlgItemScr(T2TowerDoc* towerDoc, T2ImageObj* imageObj, CPalette* GetClientRect(clientRect); switch (mClickedArea) { - case Area_SetAbsolute: { - int a, b; + case Area_Thumb: { + int thumbPosition, thumbSize; clientRect.DeflateRect(0, 16); - CalcScrollBarThumb(&a, &b); + CalcScrollBarThumb(&thumbPosition, &thumbSize); - int val = PositionToValue(clientRect) - b; + int val = PositionToValue(clientRect) - thumbSize; if (val == 0) val = 1; ScrollBarAction( - Area_SetAbsolute, + Area_Thumb, mMouseDownValue + ((PositionToValue(pt) - PositionToValue(mMouseDownPoint)) * (mRange - mPage)) / val ); break; @@ -123,10 +123,10 @@ T2DlgItemScr::T2DlgItemScr(T2TowerDoc* towerDoc, T2ImageObj* imageObj, CPalette* } } -void T2DlgItemScr::CalcScrollBarThumb(int* a, int* b) const { +void T2DlgItemScr::CalcScrollBarThumb(int* thumbPosition, int* thumbSize) const { if (!IsScrollable()) { - *a = 16; - *b = 0; + *thumbPosition = 16; + *thumbSize = 0; } else { CRect clientRect; GetClientRect(clientRect); @@ -134,10 +134,10 @@ void T2DlgItemScr::CalcScrollBarThumb(int* a, int* b) const { int value = PositionToValue(clientRect); value -= 32; - *b = (value * mPage) / mRange; - if (*b < 10) - *b = 10; - *a = (((value - *b) * mValue) / (mRange - mPage)) + 16; + *thumbSize = (value * mPage) / mRange; + if (*thumbSize < 10) + *thumbSize = 10; + *thumbPosition = (((value - *thumbSize) * mValue) / (mRange - mPage)) + 16; } } @@ -152,7 +152,7 @@ void T2DlgItemScr::ScrollBarAction(int area, int arg) { case Area_PageUp: mValue -= mPage / 2; break; - case Area_SetAbsolute: + case Area_Thumb: mValue = arg; break; case Area_PageDown: |