}
if (!layer.isBackground) {
switch (event.keyCode) {
+ case 78: /* N */ otherEnd(); return this;
case 80: /* P */ return new SelectedParallelWay(firstSelected as Way);
case 81: /* Q */ Quadrilateralise.quadrilateralise(firstSelected as Way, MainUndoStack.getGlobalStack().addAction); return this;
case 86: /* V */ Way(firstSelected).reverseNodes(MainUndoStack.getGlobalStack().addAction); return this;
return new NoSelection();
}
+ /** Jump to the other end of the way **/
+ public function otherEnd():void {
+ var n:Node = initWay.getFirstNode().within(map.edge_l, map.edge_r, map.edge_t, map.edge_b) ? initWay.getLastNode() : initWay.getFirstNode();
+ controller.map.scrollIfNeeded(n.lat,n.lon);
+ }
+
/** Officially enter this state by marking the previously nominated way as selected. */
override public function enterState():void {
if (firstSelected!=initWay) {
switch (event.keyCode) {
case 189: return removeNode(); // '-'
case 88: return splitWay(); // 'X'
+ case 78: return otherEnd(); // 'N'
case 79: return replaceNode(); // 'O'
case 81: /* Q */ Quadrilateralise.quadrilateralise(parentWay, MainUndoStack.getGlobalStack().addAction); return this;
case 82: /* R */ { if (! event.shiftKey) repeatTags(firstSelected);
return new SelectedWayNode(parentWay, ni);
}
+ /** Jump to the other end of the way **/
+ public function otherEnd():ControllerState {
+ var n:Node = parentWay.getFirstNode().within(map.edge_l, map.edge_r, map.edge_t, map.edge_b) ? parentWay.getLastNode() : parentWay.getFirstNode();
+ controller.map.scrollIfNeeded(n.lat,n.lon);
+ return new SelectedWay(parentWay);
+ }
+
}