Ignore:
Timestamp:
2012-01-19T19:58:08+01:00 (12 years ago)
Author:
bastiK
Message:

make identity of map icons depend on the name and not the image data (see #6797)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r4820 r4822  
    760760     * @return the image after rotating.
    761761     */
    762     public static ImageIcon createRotatedImage(Component c, Icon icon, double rotatedAngle) {
     762    public static Image createRotatedImage(Component c, Image img, double rotatedAngle) {
    763763        // convert rotatedAngle to a value from 0 to 360
    764764        double originalAngle = rotatedAngle % 360;
     
    775775        double radian = Math.toRadians(angle);
    776776
    777         int iw = icon.getIconWidth();
    778         int ih = icon.getIconHeight();
     777        int iw = img.getWidth(null);
     778        int ih = img.getHeight(null);
    779779        int w;
    780780        int h;
     
    802802
    803803        g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
    804         icon.paintIcon(c, g2d, -cx, -cy);
     804        g2d.drawImage(img, -cx, -cy, c);
    805805
    806806        g2d.dispose();
    807         return new ImageIcon(image);
     807        new ImageIcon(image); // load completely
     808        return image;
    808809    }
    809810
Note: See TracChangeset for help on using the changeset viewer.