Ticket #22504: 0002-Separate-move-nodes-command-code.patch

File 0002-Separate-move-nodes-command-code.patch, 1.6 KB (added by qeef, 2 years ago)
  • src/org/openstreetmap/josm/actions/AlignInCircleAction.java

    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 {  
    258258            }
    259259            radius = radius / nodes.size();
    260260        }
     261        return moveNodesCommand(nodes, fixNodes, center, radius);
     262    }
    261263
     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    {
    262279        List<Command> cmds = new LinkedList<>();
    263280
    264281        // Move each node to that distance from the center.