From 8a9200992e8faad457261a888a8689f5aa4bfda7 Mon Sep 17 00:00:00 2001 From: Ryan Leavengood Date: Sat, 2 Mar 2013 08:08:30 -0500 Subject: [PATCH] Fix Scrollbar arrow button alignment. The arrow symbol on the right and down buttons was off by one pixel. Because of the resurrected FakeScrollbar in the Appearance preflet I had to change this code in two places, which makes me unhappy. This needs to be pulled into BControlLook. Fixes #9104. --- src/kits/interface/ScrollBar.cpp | 12 ++++++------ src/preferences/appearance/FakeScrollBar.cpp | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/kits/interface/ScrollBar.cpp b/src/kits/interface/ScrollBar.cpp index 56099fa8ec..ea9918d841 100644 --- a/src/kits/interface/ScrollBar.cpp +++ b/src/kits/interface/ScrollBar.cpp @@ -1803,9 +1803,9 @@ BScrollBar::_DrawArrowButton(int32 direction, bool doubleArrows, BRect r, tri3.Set(r.right, r.bottom + 1); break; case ARROW_RIGHT: - tri1.Set(r.left, r.bottom + 1); - tri2.Set(r.left + r.Width() / 1.33, (r.top + r.bottom + 1) / 2); - tri3.Set(r.left, r.top); + tri1.Set(r.left + 1, r.bottom + 1); + tri2.Set(r.left + 1 + r.Width() / 1.33, (r.top + r.bottom + 1) / 2); + tri3.Set(r.left + 1, r.top); break; case ARROW_UP: tri1.Set(r.left, r.bottom); @@ -1813,9 +1813,9 @@ BScrollBar::_DrawArrowButton(int32 direction, bool doubleArrows, BRect r, tri3.Set(r.right + 1, r.bottom); break; default: - tri1.Set(r.left, r.top); - tri2.Set((r.left + r.right + 1) / 2, r.top + r.Height() / 1.33); - tri3.Set(r.right + 1, r.top); + tri1.Set(r.left, r.top + 1); + tri2.Set((r.left + r.right + 1) / 2, r.top + 1 + r.Height() / 1.33); + tri3.Set(r.right + 1, r.top + 1); break; } // offset triangle if down diff --git a/src/preferences/appearance/FakeScrollBar.cpp b/src/preferences/appearance/FakeScrollBar.cpp index fdbd1d1f16..7393b946f1 100644 --- a/src/preferences/appearance/FakeScrollBar.cpp +++ b/src/preferences/appearance/FakeScrollBar.cpp @@ -288,9 +288,9 @@ FakeScrollBar::_DrawArrowButton(int32 direction, bool doubleArrows, BRect r, break; case ARROW_RIGHT: - tri1.Set(r.left, r.bottom + 1); - tri2.Set(r.left + r.Width() / 1.33, (r.top + r.bottom + 1) / 2); - tri3.Set(r.left, r.top); + tri1.Set(r.left + 1, r.bottom + 1); + tri2.Set(r.left + 1 + r.Width() / 1.33, (r.top + r.bottom + 1) / 2); + tri3.Set(r.left + 1, r.top); break; case ARROW_UP: @@ -300,9 +300,9 @@ FakeScrollBar::_DrawArrowButton(int32 direction, bool doubleArrows, BRect r, break; default: - tri1.Set(r.left, r.top); - tri2.Set((r.left + r.right + 1) / 2, r.top + r.Height() / 1.33); - tri3.Set(r.right + 1, r.top); + tri1.Set(r.left, r.top + 1); + tri2.Set((r.left + r.right + 1) / 2, r.top + 1 + r.Height() / 1.33); + tri3.Set(r.right + 1, r.top + 1); break; }