Changeset 18480 in josm


Ignore:
Timestamp:
2022-06-08T23:16:08+02:00 (23 months ago)
Author:
taylor.smock
Message:

Fix JOSM #21422: Tile cache stats unreadable in debug mode (patch by gaben)

This also changes the organization of stats a bit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    r18187 r18480  
    16371637        }
    16381638        if (Logging.isDebugEnabled()) {
    1639             myDrawString(g, tr("Current zoom: {0}", currentZoomLevel), 50, 140);
    1640             myDrawString(g, tr("Display zoom: {0}", displayZoomLevel), 50, 155);
    1641             myDrawString(g, tr("Pixel scale: {0}", getScaleFactor(currentZoomLevel)), 50, 170);
    1642             myDrawString(g, tr("Best zoom: {0}", getBestZoom()), 50, 185);
    1643             myDrawString(g, tr("Estimated cache size: {0}", estimateTileCacheSize()), 50, 200);
     1639            int xOffset = 50;
     1640            myDrawString(g, tr("Current zoom: {0}", currentZoomLevel), xOffset, 165);
     1641            myDrawString(g, tr("Display zoom: {0}", displayZoomLevel), xOffset, 180);
     1642            myDrawString(g, tr("Pixel scale: {0}", getScaleFactor(currentZoomLevel)), xOffset, 195);
     1643            myDrawString(g, tr("Best zoom: {0}", getBestZoom()), xOffset, 210);
     1644            myDrawString(g, tr("Estimated cache size: {0}", estimateTileCacheSize()), xOffset, 225);
    16441645            if (tileLoader instanceof TMSCachedTileLoader) {
    1645                 int offset = 200;
     1646                int yOffset = 255;
     1647                myDrawString(g, tr("=== Cache stats ==="), xOffset, yOffset);
     1648                yOffset += 5;
    16461649                for (String part: ((TMSCachedTileLoader) tileLoader).getStats().split("\n", -1)) {
    1647                     offset += 15;
    1648                     myDrawString(g, tr("Cache stats: {0}", part), 50, offset);
     1650                    String regex = "^-{3,}(.+)";
     1651                    if (part.matches(regex)) {
     1652                        part = part.replaceAll(regex, "--- $1");
     1653                        yOffset += 5;
     1654                    }
     1655                    yOffset += 15;
     1656                    myDrawString(g, tr(part), xOffset, yOffset);
    16491657                }
    16501658            }
Note: See TracChangeset for help on using the changeset viewer.