Ticket #13453: patch-test-layer-set-name.2.patch

File patch-test-layer-set-name.2.patch, 2.2 KB (added by michael2402, 5 years ago)
  • src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    diff --git a/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java b/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
    index 2000b82..7c637bd 100644
    a b public class StyledMapRenderer extends AbstractMapRenderer { 
    928928            temporaryGraphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha));
    929929        }
    930930
     931<<<<<<< Updated upstream
    931932        double x = Math.round(p.getInViewX());
    932933        double y = Math.round(p.getInViewY());
    933934        temporaryGraphics.translate(x, y);
    public class StyledMapRenderer extends AbstractMapRenderer { 
    935936        int drawX = -w/2 + img.offsetX;
    936937        int drawY = -h/2 + img.offsetY;
    937938        temporaryGraphics.drawImage(img.getImage(disabled), drawX, drawY, nc);
     939=======
     940        double x = p.getInViewX();
     941        double y = p.getInViewY();
     942        temporaryGraphics.translate(x, y);
     943        temporaryGraphics.rotate(theta);
     944        temporaryGraphics.drawImage(img.getImage(disabled), -w/2 + img.offsetX, -h/2 + img.offsetY, w, h, nc);
     945>>>>>>> Stashed changes
    938946        if (selected || member) {
    939947            Color color;
    940948            if (disabled) {
  • test/unit/org/openstreetmap/josm/gui/layer/LayerTest.java

    diff --git a/test/unit/org/openstreetmap/josm/gui/layer/LayerTest.java b/test/unit/org/openstreetmap/josm/gui/layer/LayerTest.java
    index f7127f8..a9368d3 100644
    a b public class LayerTest { 
    9696    public void testSetName() {
    9797        testLayer.setName("Test Layer2");
    9898        assertEquals("Test Layer2", testLayer.getName());
     99
     100        testLayer = new LayerManagerTest.TestLayer() {
     101            @Override
     102            public AbstractProperty<Color> getColorProperty() {
     103                return new ColorProperty("test", Color.RED);
     104            }
     105        };
     106
     107        testLayer.setName("Test Layer2");
     108        testLayer.setName(null);
     109        assertEquals("", testLayer.getName());
     110        testLayer.setName("Test Layer3");
     111        assertEquals("Test Layer3", testLayer.getName());
    99112    }
    100113
    101114    /**