Rename rotate-way mode to just rotate

This commit is contained in:
Bryan Housel
2016-12-20 13:44:39 -05:00
parent addd12ae99
commit 57696ab5eb
4 changed files with 21 additions and 13 deletions
+1 -1
View File
@@ -6,6 +6,6 @@ export { modeDragNode } from './drag_node';
export { modeDrawArea } from './draw_area';
export { modeDrawLine } from './draw_line';
export { modeMove } from './move';
export { modeRotateWay } from './rotate_way';
export { modeRotate } from './rotate';
export { modeSave } from './save';
export { modeSelect } from './select';
+9 -1
View File
@@ -11,8 +11,12 @@ import {
} from './index';
import {
operationCircularize,
operationDelete,
operationOrthogonalize,
operationReflectLong,
operationReflectShort
operationReflectShort,
operationRotate
} from '../operations/index';
@@ -25,8 +29,12 @@ export function modeMove(context, entityIDs, baseGraph) {
var keybinding = d3keybinding('move'),
behaviors = [
behaviorEdit(context),
operationCircularize(entityIDs, context).behavior,
operationDelete(entityIDs, context).behavior,
operationOrthogonalize(entityIDs, context).behavior,
operationReflectLong(entityIDs, context).behavior,
operationReflectShort(entityIDs, context).behavior,
operationRotate(entityIDs, context).behavior
],
annotation = entityIDs.length === 1 ?
t('operations.move.annotation.' + context.geometry(entityIDs[0])) :
@@ -7,13 +7,13 @@ import { actionNoop, actionRotateWay } from '../actions/index';
import { behaviorEdit } from '../behavior/index';
export function modeRotateWay(context, wayId) {
export function modeRotate(context, wayId) {
var mode = {
id: 'rotate-way',
id: 'rotate',
button: 'browse'
};
var keybinding = d3keybinding('rotate-way'),
var keybinding = d3keybinding('rotate'),
edit = behaviorEdit(context);
@@ -33,11 +33,11 @@ export function modeRotateWay(context, wayId) {
);
context.surface()
.on('mousemove.rotate-way', rotate)
.on('click.rotate-way', finish);
.on('mousemove.rotate', rotate)
.on('click.rotate', finish);
context.history()
.on('undone.rotate-way', undone);
.on('undone.rotate', undone);
keybinding
.on('⎋', cancel)
@@ -84,11 +84,11 @@ export function modeRotateWay(context, wayId) {
context.uninstall(edit);
context.surface()
.on('mousemove.rotate-way', null)
.on('click.rotate-way', null);
.on('mousemove.rotate', null)
.on('click.rotate', null);
context.history()
.on('undone.rotate-way', null);
.on('undone.rotate', null);
keybinding.off();
};
+2 -2
View File
@@ -1,5 +1,5 @@
import { t } from '../util/locale';
import { modeRotateWay } from '../modes/index';
import { modeRotate } from '../modes/index';
import { behaviorOperation } from '../behavior/index';
@@ -11,7 +11,7 @@ export function operationRotate(selectedIDs, context) {
var operation = function() {
context.enter(modeRotateWay(context, entityId));
context.enter(modeRotate(context, entityId));
};