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 {
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | |
| 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 | |
161 | 170 | /** |
162 | 171 | * The scale in east/north units per pixel. |
163 | 172 | * @return The scale. |
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 {
|
433 | 433 | mapView.addNotify(); |
434 | 434 | mapView.doLayout(); |
435 | 435 | mapView.setBounds(0, 0, 500, 500); |
| 436 | System.err.println("MapView bounds 1: " + mapView.getBounds()); |
436 | 437 | }); |
| 438 | System.err.println("MapView bounds 2: " + mapView.getBounds()); |
437 | 439 | |
438 | 440 | this.setUpMiniMap(); |
439 | 441 | |
| 442 | System.err.println("MapView bounds 3: " + mapView.getBounds()); |
| 443 | |
440 | 444 | // assert "show downloaded areas" checkbox is unchecked |
441 | 445 | assertFalse(this.getShowDownloadedAreaMenuItem().isSelected()); |
442 | 446 | |
443 | 447 | // we won't end up with exactly this viewport as it doesn't *precisely* match the aspect ratio |
444 | 448 | mapView.zoomTo(new Bounds(51.732, -0.0269, 51.753, 0.0102)); |
445 | 449 | |
| 450 | System.err.println("MapView bounds 4: " + mapView.getBounds()); |
| 451 | |
446 | 452 | // an initial paint operation is required to trigger the tile fetches |
447 | 453 | this.paintSlippyMap(); |
448 | 454 | |
… |
… |
public class MinimapDialogTest {
|
478 | 484 | GuiHelper.runInEDTAndWaitWithException(() -> this.getShowDownloadedAreaMenuItem().doClick()); |
479 | 485 | assertTrue(this.getShowDownloadedAreaMenuItem().isSelected()); |
480 | 486 | |
| 487 | System.err.println("MapView bounds 5: " + mapView.getBounds()); |
| 488 | |
481 | 489 | // assert downloaded areas are drawn |
482 | 490 | this.paintSlippyMap(); |
483 | 491 | |
| 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 | |
484 | 498 | ImagePatternMatching.rowMatch( |
485 | 499 | paintedSlippyMap, |
486 | 500 | paintedSlippyMap.getHeight()/2, |