From 6e7e94371e0b031508a7997e23ee3222c02ba86a Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 6 Sep 2026 22:03:28 +0200 Subject: [PATCH] =?UTF-8?q?H=C3=B6hlenkarte:=20Overlay-Darstellung=20ident?= =?UTF-8?q?isch=20zur=20Weltkarte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Gebäude: Farbe korrigiert (rot wie Weltkarte), Rotation-Vorzeichen fix (-fp[4]), zoom-abhängige Linienstärke, Skip bei zu kleinen Footprints - Wege: zoom-abhängige Linienstärke (roadLineWidth) statt fester Werte - overlayLineWidth() und roadLineWidth() analog WorldMapView ergänzt Co-Authored-By: Claude Sonnet 4.6 --- .../java/de/blight/editor/ui/CaveMapView.java | 34 +++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/blight-editor/src/main/java/de/blight/editor/ui/CaveMapView.java b/blight-editor/src/main/java/de/blight/editor/ui/CaveMapView.java index 1dd3375..9a49fc7 100644 --- a/blight-editor/src/main/java/de/blight/editor/ui/CaveMapView.java +++ b/blight-editor/src/main/java/de/blight/editor/ui/CaveMapView.java @@ -292,6 +292,22 @@ public class CaveMapView extends VBox { if (cbAreas.isSelected()) drawAreasOverlay(gc); } + private double overlayLineWidth() { + return switch (zoomLevelIdx) { + case 3 -> 2.5; + case 4 -> 3.5; + default -> 1.2; + }; + } + + private double roadLineWidth() { + return switch (zoomLevelIdx) { + case 3 -> 4.5; + case 4 -> 6.0; + default -> 3.0; + }; + } + private double toCanvasX(float wx) { return panX + (wx + WorldMapRenderer.WORLD_HALF) / WorldMapRenderer.WORLD_SIZE * (RENDER_SIZE-1) * scale; } @@ -319,15 +335,19 @@ public class CaveMapView extends VBox { private void drawBuildingOverlay(GraphicsContext gc) { if (buildingFootprints.isEmpty()) return; gc.save(); - gc.setFill(Color.rgb(170, 140, 90, 0.55)); - gc.setStroke(Color.rgb(80, 60, 30, 0.8)); - gc.setLineWidth(1.0); + gc.setFill(Color.rgb(220, 100, 80, 0.50)); + gc.setStroke(Color.rgb(160, 30, 30, 0.90)); + gc.setLineWidth(overlayLineWidth()); + gc.setLineDashes(); for (float[] fp : buildingFootprints) { + double cx = toCanvasX(fp[0]); + double cz = toCanvasZ(fp[1]); double hw = fp[2] / WorldMapRenderer.WORLD_SIZE * (RENDER_SIZE-1) * scale; double hd = fp[3] / WorldMapRenderer.WORLD_SIZE * (RENDER_SIZE-1) * scale; + if (hw < 0.5 || hd < 0.5) continue; gc.save(); - gc.translate(toCanvasX(fp[0]), toCanvasZ(fp[1])); - gc.rotate(Math.toDegrees(fp[4])); + gc.translate(cx, cz); + gc.rotate(Math.toDegrees(-fp[4])); gc.fillRect(-hw, -hd, hw*2, hd*2); gc.strokeRect(-hw, -hd, hw*2, hd*2); gc.restore(); @@ -342,10 +362,10 @@ public class CaveMapView extends VBox { gc.setLineJoin(StrokeLineJoin.ROUND); gc.setLineDashes(); gc.setStroke(Color.rgb(20, 12, 5, 0.82)); - gc.setLineWidth(5.0); + gc.setLineWidth(roadLineWidth() + 2.0); for (float[][] ch : cachedPathChains) drawChain(gc, ch); gc.setStroke(Color.rgb(148, 105, 55, 0.92)); - gc.setLineWidth(3.0); + gc.setLineWidth(roadLineWidth()); for (float[][] ch : cachedPathChains) drawChain(gc, ch); gc.restore(); }