| 1112 | |
| 1113 | // Returns the toolbar position index of the specified tool |
| 1114 | int toolIndex(int tool) { |
| 1115 | switch (tool) { |
| 1116 | case RECTANGLE: return 0; |
| 1117 | case OVAL: return 1; |
| 1118 | case POLYGON: return 2; |
| 1119 | case FREEROI: return 3; |
| 1120 | case LINE: return 4; |
| 1121 | case POLYLINE: return 4; |
| 1122 | case FREELINE: return 4; |
| 1123 | case POINT: return 6; |
| 1124 | case WAND: return 7; |
| 1125 | case TEXT: return 8; |
| 1126 | case MAGNIFIER: return 9; |
| 1127 | case HAND: return 10; |
| 1128 | case DROPPER: return 11; |
| 1129 | case ANGLE: return 5; |
| 1130 | case UNUSED: return 12; |
| 1131 | default: return tool - 2; |
| 1132 | } |
| 1133 | } |
| 1134 | |
| 1135 | // Returns the tool corresponding to the specified x coordinate |
| 1136 | private int toolID(int x) { |