mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-14 17:52:55 +00:00
* Support move, rotate, reflect, delete post paste on multiselection * Improve text and error msgs for singular vs multi selections * Move `disabled` checks from actions to operations * Reproject center of rotation (closes #3667) * Cleanup tests
17 lines
514 B
JavaScript
17 lines
514 B
JavaScript
import { geoRotate } from '../geo';
|
|
import { utilGetAllNodes } from '../util';
|
|
|
|
export function actionRotate(rotateIds, pivot, angle, projection) {
|
|
|
|
var action = function(graph) {
|
|
return graph.update(function(graph) {
|
|
utilGetAllNodes(rotateIds, graph).forEach(function(node) {
|
|
var point = geoRotate([projection(node.loc)], angle, pivot)[0];
|
|
graph = graph.replace(node.move(projection.invert(point)));
|
|
});
|
|
});
|
|
};
|
|
|
|
return action;
|
|
}
|