Skip to content

Commit 768b65b

Browse files
committed
Update position of UI objects in EMG Settings UI footer
1 parent 20b3839 commit 768b65b

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

OpenBCI_GUI/EmgSettingsUI.pde

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,11 @@ class EmgSettingsUI extends PApplet implements Runnable {
119119
scene();
120120

121121
// Draw header
122+
pushStyle();
122123
noStroke();
123124
fill(HEADER_COLOR);
124125
rect(0, 0, width, HEADER_HEIGHT);
126+
popStyle();
125127

126128
emgSettingsValues = dataProcessing.emgSettings.values;
127129

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

142144
//Draw cp5 objects on top of everything
143-
emgCp5.draw();
145+
try {
146+
emgCp5.draw();
147+
} catch (ConcurrentModificationException e) {
148+
e.printStackTrace();
149+
outputError("EMG Settings UI: Unable to draw cp5 objects.");
150+
}
144151
}
145152

146153
private void scene() {
@@ -229,7 +236,8 @@ class EmgSettingsUI extends PApplet implements Runnable {
229236
}
230237

231238
private void createAllUIObjects() {
232-
footerObjY = y + h - FOOTER_PADDING/2 - FOOTER_OBJECT_HEIGHT;
239+
final int HALF_FOOTER_HEIGHT = (FOOTER_PADDING + (DROPDOWN_SPACER * 2)) / 2;
240+
footerObjY = y + h - HALF_FOOTER_HEIGHT - (FOOTER_OBJECT_HEIGHT / 2);
233241
int middle = x + w / 2;
234242
int halfObjWidth = FOOTER_OBJECT_WIDTH / 2;
235243
footerObjX[0] = middle - halfObjWidth - PADDING_12 - FOOTER_OBJECT_WIDTH;

0 commit comments

Comments
 (0)