()
| 172 | } |
| 173 | |
| 174 | function removeVertex() { |
| 175 | if(!polygons.length) return; |
| 176 | if(!polygons[indexI]) return; |
| 177 | if(!polygons[indexI].length) return; |
| 178 | |
| 179 | var newPolygon = []; |
| 180 | for(var j = 0; j < polygons[indexI].length; j++) { |
| 181 | if(j !== indexJ) { |
| 182 | newPolygon.push( |
| 183 | polygons[indexI][j] |
| 184 | ); |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | if(newPolygon.length > 1 && !( |
| 189 | newPolygon.length === 2 && newPolygon[1][0] === 'Z') |
| 190 | ) { |
| 191 | if(indexJ === 0) { |
| 192 | newPolygon[0][0] = 'M'; |
| 193 | } |
| 194 | |
| 195 | polygons[indexI] = newPolygon; |
| 196 | |
| 197 | redraw(); |
| 198 | update(); |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | function clickVertexController(numClicks, evt) { |
| 203 | if(numClicks === 2) { |
no test coverage detected
searching dependent graphs…