Skip to content

Commit

Permalink
FIXUP: JOSM-19516
Browse files Browse the repository at this point in the history
We pre-concanate the original affine transformation to the temporary
affine transformation.

Signed-off-by: Taylor Smock <tsmock@fb.com>
  • Loading branch information
tsmock committed Jul 27, 2020
1 parent 8eccd6c commit f061b01
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ public static boolean hasInstance() {
* @return The {@link MapillaryData} object that stores the database.
*/
// @Override -- depends upon JOSM 16548+
@Override
public MapillaryData getData() {
return this.data;
}
Expand Down Expand Up @@ -466,12 +467,13 @@ private void drawImageMarker(final Graphics2D g, final MapillaryAbstractImage im
AffineTransform backup = g.getTransform();
Point2D originalCentroid = getOriginalCentroid(i);
AffineTransform move = AffineTransform.getRotateInstance(angle, p.getX(), p.getY());
move.preConcatenate(backup);
move.translate(-originalCentroid.getX(), -originalCentroid.getY());
Point2D.Double d2 = new Point2D.Double(p.x + originalCentroid.getX(), p.y + originalCentroid.getY());
Point2D.Double d2 = new Point2D.Double(p.getX() + originalCentroid.getX(), p.getY() + originalCentroid.getY());
move.transform(d2, d2);
g.setTransform(move);

g.drawImage(i, p.x, p.y, null);
g.drawImage(i, (int) p.getX(), (int) p.getY(), null);
g.setTransform(backup);

// Paint highlight for selected or highlighted images
Expand Down Expand Up @@ -723,8 +725,8 @@ class DeleteImageAction extends AbstractAction {
@Override
public void actionPerformed(ActionEvent e) {
if (hasInstance() && !getData().getMultiSelectedImages().isEmpty())
MapillaryRecord.getInstance().addCommand(
new CommandDelete(getData().getMultiSelectedImages()));
MapillaryRecord.getInstance().addCommand(
new CommandDelete(getData().getMultiSelectedImages()));
}
}

Expand Down

0 comments on commit f061b01

Please sign in to comment.