Ticket #15630: v1-0001-still-with-the-debugging-test-commits.patch

File v1-0001-still-with-the-debugging-test-commits.patch, 3.2 KB (added by ris, 8 years ago)
  • src/org/openstreetmap/josm/gui/MapViewState.java

    From 4557b4daaff73274b11c7b153c248f2308737a26 Mon Sep 17 00:00:00 2001
    From: Robert Scott <code@humanleg.org.uk>
    Date: Thu, 18 Jan 2018 00:27:18 +0000
    Subject: [PATCH v1] still with the debugging test commits
    
    ---
     src/org/openstreetmap/josm/gui/MapViewState.java           |  9 +++++++++
     .../openstreetmap/josm/gui/dialogs/MinimapDialogTest.java  | 14 ++++++++++++++
     2 files changed, 23 insertions(+)
    
    diff --git a/src/org/openstreetmap/josm/gui/MapViewState.java b/src/org/openstreetmap/josm/gui/MapViewState.java
    index 0c80dadea..0e1d0444e 100644
    a b public final class MapViewState implements Serializable {  
    158158        }
    159159    }
    160160
     161    @Override
     162    public String toString() {
     163        return getClass().getName() + " [projecting=" + this.projecting
     164            + " viewWidth=" + this.viewWidth
     165            + " viewHeight=" + this.viewHeight
     166            + " scale=" + this.scale
     167            + " topLeft=" + this.topLeft + "]";
     168    }
     169
    161170    /**
    162171     * The scale in east/north units per pixel.
    163172     * @return The scale.
  • test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java

    diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java
    index cc22a6da0..559bc9f4b 100644
    a b public class MinimapDialogTest {  
    433433            mapView.addNotify();
    434434            mapView.doLayout();
    435435            mapView.setBounds(0, 0, 500, 500);
     436            System.err.println("MapView bounds 1: " + mapView.getBounds());
    436437        });
     438        System.err.println("MapView bounds 2: " + mapView.getBounds());
    437439
    438440        this.setUpMiniMap();
    439441
     442        System.err.println("MapView bounds 3: " + mapView.getBounds());
     443
    440444        // assert "show downloaded areas" checkbox is unchecked
    441445        assertFalse(this.getShowDownloadedAreaMenuItem().isSelected());
    442446
    443447        // we won't end up with exactly this viewport as it doesn't *precisely* match the aspect ratio
    444448        mapView.zoomTo(new Bounds(51.732, -0.0269, 51.753, 0.0102));
    445449
     450        System.err.println("MapView bounds 4: " + mapView.getBounds());
     451
    446452        // an initial paint operation is required to trigger the tile fetches
    447453        this.paintSlippyMap();
    448454
    public class MinimapDialogTest {  
    478484        GuiHelper.runInEDTAndWaitWithException(() -> this.getShowDownloadedAreaMenuItem().doClick());
    479485        assertTrue(this.getShowDownloadedAreaMenuItem().isSelected());
    480486
     487        System.err.println("MapView bounds 5: " + mapView.getBounds());
     488
    481489        // assert downloaded areas are drawn
    482490        this.paintSlippyMap();
    483491
     492        System.err.println("Reported bbox: " + MainApplication.getMap().mapView.getState().getViewArea().getLatLonBoundsBox().toString());
     493
     494        System.err.println("Reported MapViewState: " + MainApplication.getMap().mapView.getState());
     495
     496        System.err.println("Reported slippyMap bounding box: " + this.slippyMap.getBoundingBox());
     497
    484498        ImagePatternMatching.rowMatch(
    485499            paintedSlippyMap,
    486500            paintedSlippyMap.getHeight()/2,