From 597aa5f24d63e05b026eb14b86772d89b06ff63c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 29 Jun 2005 23:08:57 +0000 Subject: [PATCH] No longer draws any lines over the thumb area in B_BLOCK_THUMB mode. It's now completely flicker-free in that mode, all known drawing bugs are gone. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13358 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Slider.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/kits/interface/Slider.cpp b/src/kits/interface/Slider.cpp index f45b281f84..e4b5fd0e16 100644 --- a/src/kits/interface/Slider.cpp +++ b/src/kits/interface/Slider.cpp @@ -757,9 +757,10 @@ BSlider::DrawBar() lowerFrame.top++; lowerFrame.left++; BRect upperFrame = lowerFrame; + BRect thumbFrame; if (Style() == B_BLOCK_THUMB) { - BRect thumbFrame = ThumbFrame(); + thumbFrame = ThumbFrame(); if (fOrientation == B_HORIZONTAL) { lowerFrame.right = thumbFrame.left; @@ -789,7 +790,16 @@ BSlider::DrawBar() view->FillRect(lowerFrame); } - // ToDo: don't stroke the lines over the thumb + if (Style() == B_BLOCK_THUMB) { + // We don't want to stroke the lines over the thumb + + PushState(); + + BRegion region; + GetClippingRegion(®ion); + region.Exclude(thumbFrame); + ConstrainClippingRegion(®ion); + } view->SetHighColor(darken1); view->StrokeLine(BPoint(frame.left, frame.top), @@ -818,6 +828,9 @@ BSlider::DrawBar() BPoint(frame.left, frame.top)); view->StrokeLine(BPoint(frame.left + 1.0f, frame.top), BPoint(frame.right, frame.top)); + + if (Style() == B_BLOCK_THUMB) + PopState(); }