Skip to content

Commit

Permalink
Fixed volume icon centering
Browse files Browse the repository at this point in the history
  • Loading branch information
sasq64 committed Apr 15, 2016
1 parent 72e7989 commit 175a9ed
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/ChipMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ ChipMachine::ChipMachine(const std::string &wd)
}, heart_icon);
//favIcon = Icon(heart_icon, favPos.x, favPos.y, favPos.w, favPos.h);

float ww = volume_icon.width() * 15;
float hh = volume_icon.height() * 10;
volPos = {((float)screen.width() - ww) / 2.0f, ((float)screen.height() - hh) / 2.0f, ww, hh};
volumeIcon = Icon(volume_icon, volPos.x, volPos.y, volPos.w, volPos.h);

setupCommands();
setupRules();

Expand All @@ -147,10 +152,6 @@ ChipMachine::ChipMachine(const std::string &wd)
mainScreen.add(&netIcon);
netIcon.visible(false);

float ww = volume_icon.width() * 15;
float hh = volume_icon.height() * 10;
volPos = {((float)screen.width() - ww) / 2.0f, ((float)screen.height() - hh) / 2.0f, ww, hh};
volumeIcon = Icon(volume_icon, volPos.x, volPos.y, volPos.w, volPos.h);
showVolume = 0;

musicBars.setup(spectrumWidth, spectrumHeight, 24);
Expand Down Expand Up @@ -278,6 +279,11 @@ void ChipMachine::layoutScreen() {
commandField.cursorW = searchField.cursorW;

favIcon.set(favPos);

float ww = volume_icon.width() * 15;
float hh = volume_icon.height() * 10;
volPos = {((float)screen.width() - ww) / 2.0f, ((float)screen.height() - hh) / 2.0f, ww, hh};
volumeIcon.set(volPos);
}

void ChipMachine::play(const SongInfo &si) {
Expand Down

0 comments on commit 175a9ed

Please sign in to comment.