Skip to content

Commit

Permalink
Update position of UI objects in EMG Settings UI footer
Browse files Browse the repository at this point in the history
  • Loading branch information
retiutut committed Jul 11, 2023
1 parent 20b3839 commit 768b65b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions OpenBCI_GUI/EmgSettingsUI.pde
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,11 @@ class EmgSettingsUI extends PApplet implements Runnable {
scene();

// Draw header
pushStyle();
noStroke();
fill(HEADER_COLOR);
rect(0, 0, width, HEADER_HEIGHT);
popStyle();

emgSettingsValues = dataProcessing.emgSettings.values;

Expand All @@ -140,7 +142,12 @@ class EmgSettingsUI extends PApplet implements Runnable {
drawChannelLabels();

//Draw cp5 objects on top of everything
emgCp5.draw();
try {
emgCp5.draw();
} catch (ConcurrentModificationException e) {
e.printStackTrace();
outputError("EMG Settings UI: Unable to draw cp5 objects.");
}
}

private void scene() {
Expand Down Expand Up @@ -229,7 +236,8 @@ class EmgSettingsUI extends PApplet implements Runnable {
}

private void createAllUIObjects() {
footerObjY = y + h - FOOTER_PADDING/2 - FOOTER_OBJECT_HEIGHT;
final int HALF_FOOTER_HEIGHT = (FOOTER_PADDING + (DROPDOWN_SPACER * 2)) / 2;
footerObjY = y + h - HALF_FOOTER_HEIGHT - (FOOTER_OBJECT_HEIGHT / 2);
int middle = x + w / 2;
int halfObjWidth = FOOTER_OBJECT_WIDTH / 2;
footerObjX[0] = middle - halfObjWidth - PADDING_12 - FOOTER_OBJECT_WIDTH;
Expand Down

0 comments on commit 768b65b

Please sign in to comment.