* fix some invalidation problems with the triangle thumb which are caused by
non-traight lines extending past the thumb frame because of anti-aliasing effects git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23286 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -615,15 +615,6 @@ BSlider::SetValue(int32 value)
|
|||||||
|
|
||||||
BRect oldThumbFrame = ThumbFrame();
|
BRect oldThumbFrame = ThumbFrame();
|
||||||
|
|
||||||
if (IsFocus() && Style() == B_TRIANGLE_THUMB) {
|
|
||||||
// we need to update the region with the focus mark as well
|
|
||||||
// (a method BSlider::FocusMarkFrame() would be nice as well)
|
|
||||||
if (fOrientation == B_HORIZONTAL)
|
|
||||||
oldThumbFrame.bottom += 2;
|
|
||||||
else
|
|
||||||
oldThumbFrame.left -= 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
// While it would be enough to do this dependent on fUseFillColor,
|
// While it would be enough to do this dependent on fUseFillColor,
|
||||||
// that doesn't work out if DrawBar() has been overridden by a sub class
|
// that doesn't work out if DrawBar() has been overridden by a sub class
|
||||||
if (fOrientation == B_HORIZONTAL)
|
if (fOrientation == B_HORIZONTAL)
|
||||||
@@ -634,7 +625,25 @@ BSlider::SetValue(int32 value)
|
|||||||
_SetLocation(loc);
|
_SetLocation(loc);
|
||||||
|
|
||||||
BControl::SetValueNoUpdate(value);
|
BControl::SetValueNoUpdate(value);
|
||||||
Invalidate(oldThumbFrame | ThumbFrame());
|
BRect invalid = oldThumbFrame | ThumbFrame();
|
||||||
|
|
||||||
|
if (Style() == B_TRIANGLE_THUMB) {
|
||||||
|
// 1) we need to take care of pixels touched because of
|
||||||
|
// anti-aliasing
|
||||||
|
// 2) we need to update the region with the focus mark as well
|
||||||
|
// (a method BSlider::FocusMarkFrame() would be nice as well)
|
||||||
|
if (fOrientation == B_HORIZONTAL) {
|
||||||
|
if (IsFocus())
|
||||||
|
invalid.bottom += 2;
|
||||||
|
invalid.InsetBy(-1, 0);
|
||||||
|
} else {
|
||||||
|
if (IsFocus())
|
||||||
|
invalid.left -= 2;
|
||||||
|
invalid.InsetBy(0, -1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Invalidate(invalid);
|
||||||
|
|
||||||
// update text label
|
// update text label
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user