Changeset 4822 in josm for trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
- Timestamp:
- 2012-01-19T19:58:08+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r4820 r4822 760 760 * @return the image after rotating. 761 761 */ 762 public static Image Icon createRotatedImage(Component c, Icon icon, double rotatedAngle) {762 public static Image createRotatedImage(Component c, Image img, double rotatedAngle) { 763 763 // convert rotatedAngle to a value from 0 to 360 764 764 double originalAngle = rotatedAngle % 360; … … 775 775 double radian = Math.toRadians(angle); 776 776 777 int iw = i con.getIconWidth();778 int ih = i con.getIconHeight();777 int iw = img.getWidth(null); 778 int ih = img.getHeight(null); 779 779 int w; 780 780 int h; … … 802 802 803 803 g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC); 804 icon.paintIcon(c, g2d, -cx, -cy);804 g2d.drawImage(img, -cx, -cy, c); 805 805 806 806 g2d.dispose(); 807 return new ImageIcon(image); 807 new ImageIcon(image); // load completely 808 return image; 808 809 } 809 810
Note:
See TracChangeset
for help on using the changeset viewer.