Variable name refactoring. They are knobs, not marks
This commit is contained in:
@@ -1173,7 +1173,7 @@ BScrollBar::Draw(BRect updateRect)
|
|||||||
float hmiddle = rect.Width() / 2;
|
float hmiddle = rect.Width() / 2;
|
||||||
float vmiddle = rect.Height() / 2;
|
float vmiddle = rect.Height() / 2;
|
||||||
|
|
||||||
BRect middleMark = BRect(
|
BRect middleKnob = BRect(
|
||||||
rect.left + hmiddle
|
rect.left + hmiddle
|
||||||
- (fOrientation == B_HORIZONTAL ? hextent : vextent),
|
- (fOrientation == B_HORIZONTAL ? hextent : vextent),
|
||||||
rect.top + vmiddle
|
rect.top + vmiddle
|
||||||
@@ -1184,33 +1184,33 @@ BScrollBar::Draw(BRect updateRect)
|
|||||||
+ (fOrientation == B_HORIZONTAL ? vextent : hextent));
|
+ (fOrientation == B_HORIZONTAL ? vextent : hextent));
|
||||||
|
|
||||||
if (fOrientation == B_HORIZONTAL) {
|
if (fOrientation == B_HORIZONTAL) {
|
||||||
BRect leftMark = middleMark.OffsetByCopy(hextent * -4, 0);
|
BRect leftKnob = middleKnob.OffsetByCopy(hextent * -4, 0);
|
||||||
if (leftMark.left > rect.left + hextent) {
|
if (leftKnob.left > rect.left + hextent) {
|
||||||
be_control_look->DrawButtonBackground(this, leftMark, updateRect,
|
be_control_look->DrawButtonBackground(this, leftKnob, updateRect,
|
||||||
normal, flags, BControlLook::B_ALL_BORDERS, fOrientation);
|
normal, flags, BControlLook::B_ALL_BORDERS, fOrientation);
|
||||||
}
|
}
|
||||||
|
|
||||||
BRect rightMark = middleMark.OffsetByCopy(hextent * 4, 0);
|
BRect rightKnob = middleKnob.OffsetByCopy(hextent * 4, 0);
|
||||||
if (rightMark.right < rect.right - hextent) {
|
if (rightKnob.right < rect.right - hextent) {
|
||||||
be_control_look->DrawButtonBackground(this, rightMark, updateRect,
|
be_control_look->DrawButtonBackground(this, rightKnob, updateRect,
|
||||||
normal, flags, BControlLook::B_ALL_BORDERS, fOrientation);
|
normal, flags, BControlLook::B_ALL_BORDERS, fOrientation);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
BRect topMark = middleMark.OffsetByCopy(0, hextent * -4);
|
BRect topKnob = middleKnob.OffsetByCopy(0, hextent * -4);
|
||||||
if (topMark.top > rect.top + vextent) {
|
if (topKnob.top > rect.top + vextent) {
|
||||||
be_control_look->DrawButtonBackground(this, topMark, updateRect,
|
be_control_look->DrawButtonBackground(this, topKnob, updateRect,
|
||||||
normal, flags, BControlLook::B_ALL_BORDERS, fOrientation);
|
normal, flags, BControlLook::B_ALL_BORDERS, fOrientation);
|
||||||
}
|
}
|
||||||
|
|
||||||
BRect bottomMark = middleMark.OffsetByCopy(0, hextent * 4);
|
BRect bottomKnob = middleKnob.OffsetByCopy(0, hextent * 4);
|
||||||
if (bottomMark.bottom < rect.bottom - vextent) {
|
if (bottomKnob.bottom < rect.bottom - vextent) {
|
||||||
be_control_look->DrawButtonBackground(this, bottomMark, updateRect,
|
be_control_look->DrawButtonBackground(this, bottomKnob, updateRect,
|
||||||
normal, flags, BControlLook::B_ALL_BORDERS, fOrientation);
|
normal, flags, BControlLook::B_ALL_BORDERS, fOrientation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw middle mark last because it modifies middleMark
|
// draw middle mark last because it modifies middleKnob
|
||||||
be_control_look->DrawButtonBackground(this, middleMark, updateRect,
|
be_control_look->DrawButtonBackground(this, middleKnob, updateRect,
|
||||||
normal, flags, BControlLook::B_ALL_BORDERS, fOrientation);
|
normal, flags, BControlLook::B_ALL_BORDERS, fOrientation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user