Ignore:
Timestamp:
2013-03-23T07:12:15+01:00 (12 years ago)
Author:
the111
Message:

Fix #josm8534 - AttributionSupport does not clear out old link bounds values

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/AttributionSupport.java

    r29244 r29385  
    5555
    5656    public void paintAttribution(Graphics g, int width, int height, Coordinate topLeft, Coordinate bottomRight, int zoom, ImageObserver observer) {
    57         if (source == null || !source.requiresAttribution())
    58             return;
     57        if (source == null || !source.requiresAttribution()) {
     58            attrToUBounds = null;
     59            attrImageBounds = null;
     60            attrTextBounds = null;
     61            return;           
     62        }
     63       
    5964        // Draw attribution
    6065        Font font = g.getFont();
     
    7883            g.setColor(Color.white);
    7984            g.drawString(attrTermsText, x, y);
     85        } else {
     86            attrToUBounds = null;
    8087        }
    8188
     
    8895            attrImageBounds = new Rectangle(x, y, imgWidth, imgHeight);
    8996            g.drawImage(attrImage, x, y, null);
     97        } else {
     98            attrImageBounds = null;
    9099        }
    91100
     
    102111            g.drawString(attributionText, x, y);
    103112            attrTextBounds = new Rectangle(x, y-textHeight, (int) stringBounds.getWidth(), (int) stringBounds.getHeight());
     113        } else {
     114            attrTextBounds = null;
    104115        }
    105116
Note: See TracChangeset for help on using the changeset viewer.