From 84c62f1d46c54b62c62aca5e3518cdaaf2b0ddbd Mon Sep 17 00:00:00 2001 From: Brian Hill Date: Tue, 2 May 2017 19:37:09 -0400 Subject: [PATCH] Fix drawing of Tracker volume icon freespace bar For icon sizes less than B_LARGE_ICON (32) the icon size was incorrectly just set to B_MINI_ICON (16) causing an error in where horizontally the free space bar was drawn for icon sizes between 16 and 32. This has never really been an issue because the predefined options in Tracker do not allow selecting an icon size between 16 and 32, but this fix will prevent drawing issues in the future if that ever does become an option. --- src/kits/tracker/Pose.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/kits/tracker/Pose.cpp b/src/kits/tracker/Pose.cpp index 8479be6d3f..49d7cb3dab 100644 --- a/src/kits/tracker/Pose.cpp +++ b/src/kits/tracker/Pose.cpp @@ -834,21 +834,15 @@ BPose::DrawBar(BPoint where, BView* view, icon_size which) { view->PushState(); - int32 size; - int32 barWidth; - int32 barHeight; + int32 size = which - 1; int32 yOffset; - if (which >= B_LARGE_ICON) { - size = which - 1; - barWidth = (int32)(7.0f / 32.0f * (float)which); - yOffset = 2; - barHeight = size - 4 - 2 * yOffset; - } else { - size = B_MINI_ICON; + int32 barWidth = (int32)(7.0f / 32.0f * (float)which); + if (barWidth < 4) { barWidth = 4; yOffset = 0; - barHeight = size - 4 - 2 * yOffset; - } + } else + yOffset = 2; + int32 barHeight = size - 4 - 2 * yOffset; // the black shadowed line view->SetHighColor(32, 32, 32, 92);