Changeset 19568 in josm for trunk


Ignore:
Timestamp:
2026-04-17T07:46:00+02:00 (6 days ago)
Author:
GerdP
Message:

see #24695: Unpredictable result when scaling or rotating an object again
fix unit tests (testEqualsContract())

Location:
trunk/src/org/openstreetmap/josm/command
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/RotateCommand.java

    r19566 r19568  
    124124    @Override
    125125    public int hashCode() {
    126         return Objects.hash(super.hashCode(), pivot, startAngle, rotationAngle);
     126        return Objects.hash(super.hashCode(), pivot, startAngle, rotationAngle, deltaAngle);
    127127    }
    128128
     
    135135        return Double.compare(that.startAngle, startAngle) == 0 &&
    136136                Double.compare(that.rotationAngle, rotationAngle) == 0 &&
    137                 Objects.equals(pivot, that.pivot);
     137                Objects.equals(pivot, that.pivot) &&
     138                Objects.equals(deltaAngle, that.deltaAngle);
    138139    }
    139140}
  • trunk/src/org/openstreetmap/josm/command/ScaleCommand.java

    r19566 r19568  
    123123    @Override
    124124    public int hashCode() {
    125         return Objects.hash(super.hashCode(), pivot, scalingFactor, startEN);
     125        return Objects.hash(super.hashCode(), pivot, scalingFactor, startEN, deltaScalingFactor);
    126126    }
    127127
     
    134134        return Double.compare(that.scalingFactor, scalingFactor) == 0 &&
    135135                Objects.equals(pivot, that.pivot) &&
    136                 Objects.equals(startEN, that.startEN);
     136                Objects.equals(startEN, that.startEN) &&
     137                Objects.equals(deltaScalingFactor, that.deltaScalingFactor);
    137138    }
    138139}
Note: See TracChangeset for help on using the changeset viewer.