Changeset 17632 in josm


Ignore:
Timestamp:
2021-03-21T23:03:04+01:00 (3 years ago)
Author:
simon04
Message:

fix #20101 - Rotate & scale tool: show angle or scale factor in status bar

Location:
trunk/src/org/openstreetmap/josm
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r17421 r17632  
    881881            return; // Don't create zero length way segments.
    882882
    883         showStatusInfo(-1, -1, -1, snapHelper.isSnapOn());
     883        showStatusInfo(Double.NaN, -1, -1, snapHelper.isSnapOn());
    884884
    885885        double curHdg = Utils.toDegrees(getCurrentBaseNode().getEastNorth()
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawSnapHelper.java

    r14149 r17632  
    341341        EastNorth p0 = drawAction.getCurrentBaseNode().getEastNorth();
    342342        EastNorth snapPoint = currentEN;
    343         double angle = -1;
     343        double angle = Double.NaN;
    344344
    345345        double activeBaseHeading = (customBaseHeading >= 0) ? customBaseHeading : baseHeading;
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r17473 r17632  
    5959import org.openstreetmap.josm.tools.PlatformManager;
    6060import org.openstreetmap.josm.tools.Shortcut;
     61import org.openstreetmap.josm.tools.Utils;
    6162
    6263/**
     
    768769                if (doesImpactStatusLine(affectedNodes, ways)) {
    769770                    MainApplication.getMap().statusLine.setDist(ways);
     771                }
     772                if (c instanceof RotateCommand) {
     773                    double angle = Utils.toDegrees(((RotateCommand) c).getRotationAngle());
     774                    MainApplication.getMap().statusLine.setAngle(angle);
     775                } else if (c instanceof ScaleCommand) {
     776                    // U+00D7 MULTIPLICATION SIGN
     777                    String angle = String.format("%.2f", ((ScaleCommand) c).getScalingFactor()) + " \u00d7";
     778                    MainApplication.getMap().statusLine.setAngleText(angle);
    770779                }
    771780                return true;
  • trunk/src/org/openstreetmap/josm/command/RotateCommand.java

    r17333 r17632  
    7979
    8080    /**
     81     * Returns the rotation angle.
     82     * @return The rotation angle
     83     */
     84    public double getRotationAngle() {
     85        return rotationAngle;
     86    }
     87
     88    /**
    8189     * Rotate nodes.
    8290     */
  • trunk/src/org/openstreetmap/josm/command/ScaleCommand.java

    r17333 r17632  
    7575
    7676    /**
     77     * Returns the scaling factor.
     78     * @return The scaling factor
     79     */
     80    public double getScalingFactor() {
     81        return scalingFactor;
     82    }
     83
     84    /**
    7785     * Scale nodes.
    7886     */
  • trunk/src/org/openstreetmap/josm/gui/MapStatus.java

    r17585 r17632  
    10851085
    10861086    /**
     1087     * Sets the angle to display in the angle panel. NaN yields "--".
     1088     * @param a The angle
     1089     */
     1090    public void setAngle(double a) {
     1091        angleText.setText(!Double.isFinite(a) ? "--" : DECIMAL_FORMAT.format(a) + " \u00B0");
     1092    }
     1093
     1094    /**
    10871095     * Sets the angle to display in the angle panel
    1088      * @param a The angle
    1089      */
    1090     public void setAngle(double a) {
    1091         angleText.setText(a < 0 ? "--" : DECIMAL_FORMAT.format(a) + " \u00B0");
     1096     * @param text The angle text
     1097     */
     1098    public void setAngleText(String text) {
     1099        angleText.setText(text);
    10921100    }
    10931101
Note: See TracChangeset for help on using the changeset viewer.