From fb7278e3fc789fcd578a68f8eb15488f85ffe077 Mon Sep 17 00:00:00 2001 From: piegames Date: Sun, 9 Aug 2020 12:27:33 +0200 Subject: [PATCH] Fix MapPin for multiple maps --- .../piegames/blockmap/gui/decoration/Pin.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/BlockMap-gui/src/main/java/de/piegames/blockmap/gui/decoration/Pin.java b/BlockMap-gui/src/main/java/de/piegames/blockmap/gui/decoration/Pin.java index 2f8976a..8048b9b 100644 --- a/BlockMap-gui/src/main/java/de/piegames/blockmap/gui/decoration/Pin.java +++ b/BlockMap-gui/src/main/java/de/piegames/blockmap/gui/decoration/Pin.java @@ -22,10 +22,6 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import de.piegames.blockmap.gui.standalone.SimpleImageCache; -import de.piegames.blockmap.gui.standalone.SimplePlayerProfileCache; -import javafx.embed.swing.SwingFXUtils; -import javafx.scene.image.*; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.controlsfx.control.PopOver; @@ -43,6 +39,8 @@ import de.piegames.blockmap.MinecraftVersion; import de.piegames.blockmap.gui.DisplayViewport; +import de.piegames.blockmap.gui.standalone.SimpleImageCache; +import de.piegames.blockmap.gui.standalone.SimplePlayerProfileCache; import de.piegames.blockmap.world.ChunkMetadata; import de.piegames.blockmap.world.ChunkMetadata.ChunkMetadataCulled; import de.piegames.blockmap.world.ChunkMetadata.ChunkMetadataFailed; @@ -64,12 +62,16 @@ import javafx.beans.binding.DoubleBinding; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; +import javafx.embed.swing.SwingFXUtils; import javafx.scene.CacheHint; import javafx.scene.Node; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.Separator; import javafx.scene.control.Tooltip; +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; +import javafx.scene.image.WritableImage; import javafx.scene.input.MouseButton; import javafx.scene.layout.BorderPane; import javafx.scene.layout.GridPane; @@ -600,9 +602,9 @@ private static class MapPin extends Pin { } } - protected List maps; + protected List maps; - public MapPin(Vector2d position, List maps, DisplayViewport viewport) { + public MapPin(Vector2d position, List maps, DisplayViewport viewport) { super(position, PinType.MAP_POSITION, viewport); this.maps = Objects.requireNonNull(maps); } @@ -620,7 +622,7 @@ protected PopOver initInfo() { content.add(new Label(Integer.toString(maps.size())), 1, rowCount++); } - for (de.piegames.blockmap.world.LevelMetadata.MapPin map : maps) { + for (LevelMetadata.MapPin map : maps) { BorderPane mapPane = new BorderPane(); mapPane.setLeft(new Label("Scale:")); mapPane.setRight(new Label("1:" + (1 << map.getScale()))); @@ -633,7 +635,7 @@ protected PopOver initInfo() { image.getPixelWriter().setColor(x, y, COLOR_IDS[0xFF & data[y << 7 | x]]); mapPane.setBottom(new ImageView(image)); } - content.add(mapPane, 0, rowCount++, 1, 2); + content.add(mapPane, 0, rowCount++, 2, 1); } info.setContentNode(content); return info;