Skip to content

Commit a728118

Browse files
committed
add patch for Play Button not working (issue processing#688)
1 parent 447b207 commit a728118

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

app/src/processing/app/EditorToolbar.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,6 @@ public void mouseMoved(MouseEvent e) {
310310
int x = e.getX();
311311
int y = e.getY();
312312

313-
// if (currentRollover != -1) {
314313
if (rollover != null) {
315314
// if ((x > x1[currentRollover]) && (y > y1) &&
316315
// (x < x2[currentRollover]) && (y < y2)) {
@@ -319,9 +318,9 @@ public void mouseMoved(MouseEvent e) {
319318
return;
320319

321320
} else {
322-
// setState(currentRollover, INACTIVE, true);
323-
rollover.setState(INACTIVE, true);
324-
// currentRollover = -1;
321+
if (rollover.state == ROLLOVER) {
322+
rollover.setState(INACTIVE, true);
323+
}
325324
rollover = null;
326325
}
327326
}
@@ -429,7 +428,9 @@ public void mouseExited(MouseEvent e) {
429428
// there is no more rollover, make sure that the rollover text goes away
430429
// currentRollover = -1;
431430
if (rollover != null) {
432-
rollover.setState(INACTIVE, true);
431+
if (rollover.state == ROLLOVER) {
432+
rollover.setState(INACTIVE, true);
433+
}
433434
rollover = null;
434435
}
435436
}

app/src/processing/mode/java/JavaEditor.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,12 +464,11 @@ protected boolean handleExportCheckModified() {
464464

465465

466466
public void handleRun() {
467-
toolbar.activate(JavaToolbar.RUN);
468-
469467
new Thread(new Runnable() {
470468
public void run() {
471469
prepareRun();
472470
try {
471+
toolbar.activate(JavaToolbar.RUN);
473472
runtime = jmode.handleRun(sketch, JavaEditor.this);
474473
// System.out.println("runtime now " + runtime);
475474
} catch (Exception e) {
@@ -481,12 +480,11 @@ public void run() {
481480

482481

483482
public void handlePresent() {
484-
toolbar.activate(JavaToolbar.RUN);
485-
486483
new Thread(new Runnable() {
487484
public void run() {
488485
prepareRun();
489486
try {
487+
toolbar.activate(JavaToolbar.RUN);
490488
runtime = jmode.handlePresent(sketch, JavaEditor.this);
491489
} catch (Exception e) {
492490
statusError(e);

0 commit comments

Comments
 (0)