From 915a8e30ae735e7660e7a87bec77b0982b5abc15 Mon Sep 17 00:00:00 2001
From: Jiri Vlasak <jiri.hubacek@gmail.com>
Date: Mon, 14 Nov 2022 21:35:28 +0100
Subject: [PATCH 2/3] Separate move nodes command code
---
.../josm/actions/AlignInCircleAction.java | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/src/org/openstreetmap/josm/actions/AlignInCircleAction.java b/src/org/openstreetmap/josm/actions/AlignInCircleAction.java
index 42bec22818..ee03219f7c 100644
a
|
b
|
public final class AlignInCircleAction extends JosmAction {
|
258 | 258 | } |
259 | 259 | radius = radius / nodes.size(); |
260 | 260 | } |
| 261 | return moveNodesCommand(nodes, fixNodes, center, radius); |
| 262 | } |
261 | 263 | |
| 264 | /** |
| 265 | * Move each node of the list of nodes to be arranged in a circle. |
| 266 | * @param nodes The list of nodes to be moved. |
| 267 | * @param fixNodes The list of nodes that must not be moved. |
| 268 | * @param center A center of the circle formed by the nodes. |
| 269 | * @param radius A radius of the circle fromed by the nodes. |
| 270 | * @return the command that arranges the nodes in a circle. |
| 271 | * @since xxx |
| 272 | */ |
| 273 | public static Command moveNodesCommand( |
| 274 | List<Node> nodes, |
| 275 | Set<Node> fixNodes, |
| 276 | EastNorth center, |
| 277 | double radius) throws InvalidSelection |
| 278 | { |
262 | 279 | List<Command> cmds = new LinkedList<>(); |
263 | 280 | |
264 | 281 | // Move each node to that distance from the center. |