Skip to content

Commit

Permalink
Fix UI issues
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Smock <[email protected]>
  • Loading branch information
tsmock committed Apr 28, 2022
1 parent 47fc391 commit 351ba66
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ private void drawImageMarker(final INode selectedImg, final Graphics2D g, final
* if (Objects.equals(selectedImg, img))
* angle += MapillaryMainDialog.getInstance().imageViewer.getRotation();
*/
g.setTransform(getTransform(angle, p, getOriginalCentroid(i), backup));
g.setTransform(getTransform(angle, p, getOriginalCentroid(i)));
g.drawImage(i, p.x, p.y, null);
g.setTransform(backup);
}
Expand All @@ -500,7 +500,7 @@ private void drawImageMarker(final INode selectedImg, final Graphics2D g, final
|| (selectedImg != null && selectedImg.equals(img))) {
g.setColor(Color.WHITE);
g.setStroke(new BasicStroke(2));
g.drawOval(p.x - IMG_MARKER_RADIUS, p.y - IMG_MARKER_RADIUS, 2 * IMG_MARKER_RADIUS, 2 * IMG_MARKER_RADIUS);
g.drawOval(-IMG_MARKER_RADIUS, -IMG_MARKER_RADIUS, 2 * IMG_MARKER_RADIUS, 2 * IMG_MARKER_RADIUS);
}
// TODO get the following working
/*
Expand All @@ -524,6 +524,7 @@ private void drawImageMarker(final INode selectedImg, final Graphics2D g, final
g.setColor(MapillaryColorScheme.SEQ_IMPORTED_HIGHLIGHTED);
g.fillOval(p.x - radius, p.y - radius, 2 * radius, 2 * radius);
}
g.setTransform(AffineTransform.getTranslateInstance(0, 0));
}

/**
Expand All @@ -532,12 +533,10 @@ private void drawImageMarker(final INode selectedImg, final Graphics2D g, final
* @param angle The angle to rotate (radians)
* @param p The point to transform around
* @param origin The origin of the transform
* @param original the original affine transform
* @return An affine transform to rotate around an arbitrary point
*/
public static AffineTransform getTransform(double angle, Point p, Point2D origin, AffineTransform original) {
private static AffineTransform getTransform(double angle, Point p, Point2D origin) {
AffineTransform move = AffineTransform.getRotateInstance(angle, p.getX(), p.getY());
move.preConcatenate(original);
move.translate(-origin.getX(), -origin.getY());
Point2D.Double d2 = new Point2D.Double(p.x + origin.getX(), p.y + origin.getY());
move.transform(d2, d2);
Expand Down

0 comments on commit 351ba66

Please sign in to comment.