Ignore:
Timestamp:
2010-12-02T18:52:49+01:00 (14 years ago)
Author:
upliner
Message:

fix issues with TMS layer shift and attribution displaying

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapLayer.java

    r24488 r24530  
    1414import java.awt.event.MouseAdapter;
    1515import java.awt.event.MouseEvent;
     16import java.awt.font.TextAttribute;
    1617import java.awt.geom.Rectangle2D;
    1718import java.awt.image.ImageObserver;
     
    2021import java.net.URISyntaxException;
    2122import java.util.ArrayList;
     23import java.util.HashMap;
    2224import java.util.HashSet;
    2325import java.util.LinkedList;
     
    112114    private String attrTermsUrl;
    113115    private Rectangle attrImageBounds, attrToUBounds;
    114     private static Font ATTR_FONT = Font.decode("Arial 10");
    115     private static Font ATTR_LINK_FONT = Font.decode("Arial Underline 10");
     116    private static final Font ATTR_FONT = new Font("Arial", Font.PLAIN, 10);
     117    private static final Font ATTR_LINK_FONT;
     118    static {
     119        HashMap<TextAttribute, Integer> aUnderline = new HashMap<TextAttribute, Integer>();
     120        aUnderline.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
     121        ATTR_LINK_FONT = ATTR_FONT.deriveFont(aUnderline);
     122    }
    116123
    117124    void redraw()
     
    979986                int x = 2;
    980987                int height = attrImage.getHeight(this);
    981                 int y = termsTextY - height;
     988                int y = termsTextY - height - textHeight - 5;
    982989                attrImageBounds = new Rectangle(x, y, imgWidth, height);
    983990                g.drawImage(attrImage, x, y, this);
    984991            }
    985992           
     993            g.setFont(ATTR_FONT);
    986994            String attributionText = tileSource.getAttributionText(currentZoomLevel, topLeft, botRight);
    987995            Rectangle2D stringBounds = g.getFontMetrics().getStringBounds(attributionText, g);
Note: See TracChangeset for help on using the changeset viewer.