Skip to content

Commit

Permalink
Merge branch 'hotfix/#40-5-move-bar-segments'
Browse files Browse the repository at this point in the history
  • Loading branch information
warmsound committed Jun 17, 2018
2 parents 2bba188 + d9a8444 commit 04bcb2d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source/MoveBar.mc
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ class MoveBar extends Ui.Drawable {
var barX = x + mTailWidth;
var moveBarStyle = MOVE_BAR_STYLE[App.getApp().getProperty("MoveBarStyle")];

for (var i = 1; i < ActivityMonitor.MOVE_BAR_LEVEL_MAX; ++i) {
// One-based, to correspond with move bar level (zero means no bars).
for (var i = 1; i <= ActivityMonitor.MOVE_BAR_LEVEL_MAX; ++i) {

// First bar is double width.
if (i == 1) {
Expand All @@ -151,7 +152,7 @@ class MoveBar extends Ui.Drawable {
break;
}

Sys.println("drawBar " + i + " at x=" + x);
Sys.println("drawBar " + i + " at x=" + barX);
drawBar(dc, thisBarColour, barX, y + (mHeight / 2), thisBarWidth);

barX += thisBarWidth + mSeparator;
Expand All @@ -160,7 +161,7 @@ class MoveBar extends Ui.Drawable {

function getBarWidth() {
// Maximum number of bars actually shown.
var numBars = ActivityMonitor.MOVE_BAR_LEVEL_MAX - ActivityMonitor.MOVE_BAR_LEVEL_MIN - 1;
var numBars = ActivityMonitor.MOVE_BAR_LEVEL_MAX - ActivityMonitor.MOVE_BAR_LEVEL_MIN;

// Subtract tail width, and total separator width.
var availableWidth = mCurrentWidth - mTailWidth - ((numBars - 1) * mSeparator);
Expand Down

0 comments on commit 04bcb2d

Please sign in to comment.