Ticket #24762: 24762.patch
| File 24762.patch, 2.3 KB (added by , 21 hours ago) |
|---|
-
src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
509 509 Point p = mv.getPoint(e.getPos()); 510 510 Dimension imgDim = getImageDimension(e); 511 511 512 if (e.getExifImgDir() != null) { 512 Double direction = e.getExifImgDir(); 513 if (direction == null) 514 direction = e.getExifGpsTrack(); // see #24762 515 if (direction != null) { 513 516 Vector3D imgRotation = ImageViewerDialog.getInstance().getRotation(e); 514 drawDirectionArrow(g, p, e.getExifImgDir() 515 + (imgRotation != null ? Utils.toDegrees(imgRotation.getPolarAngle()) : 0d), imgDim); 517 final Color color = e.getExifImgDir() != null ? new Color(255, 255, 255, 192) : Color.darkGray; 518 drawDirectionArrow(g, p, 519 direction + (imgRotation != null ? Utils.toDegrees(imgRotation.getPolarAngle()) : 0d), 520 imgDim, color); 516 521 } 517 522 518 523 if (useThumbs && e.hasThumbnail()) { … … 541 546 } 542 547 543 548 protected static void drawDirectionArrow(Graphics2D g, Point p, double dir, Dimension imgDim) { 549 drawDirectionArrow(g, p, dir, imgDim, new Color(255, 255, 255, 192)); 550 } 551 552 protected static void drawDirectionArrow(Graphics2D g, Point p, double dir, Dimension imgDim, Color color) { 544 553 // Multiplier must be larger than sqrt(2)/2=0.71. 545 554 double arrowlength = Math.max(25, Math.max(imgDim.width, imgDim.height) * 0.85); 546 555 double arrowwidth = arrowlength / 1.4; … … 560 569 double rty = p.y + Math.sin(Utils.toRadians(rightdir)) * arrowwidth/2; 561 570 562 571 g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 563 g.setColor( new Color(255, 255, 255, 192));572 g.setColor(color); 564 573 int[] xar = {(int) ltx, (int) ptx, (int) rtx, (int) ltx}; 565 574 int[] yar = {(int) lty, (int) pty, (int) rty, (int) lty}; 566 575 g.fillPolygon(xar, yar, 4);
