MCPcopy Index your code
hub / github.com/arduino/Arduino / findSelection

Method findSelection

app/src/processing/app/EditorToolbar.java:383–396  ·  view source on GitHub ↗
(int x, int y)

Source from the content-addressed store, hash-verified

381
382
383 private int findSelection(int x, int y) {
384 // if app loads slowly and cursor is near the buttons
385 // when it comes up, the app may not have time to load
386 if ((x1 == null) || (x2 == null)) return -1;
387
388 for (int i = 0; i < buttonCount; i++) {
389 if ((y > y1) && (x > x1[i]) &&
390 (y < y2) && (x < x2[i])) {
391 //System.out.println("sel is " + i);
392 return i;
393 }
394 }
395 return -1;
396 }
397
398
399 private void setState(int slot, int newState, boolean updateAfter) {

Callers 2

handleMouseMethod · 0.95
mousePressedMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected