From 972d5d6e0be47c0c0f8522cd263d7168e6a3b382 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 3 Sep 2026 17:47:19 +0200 Subject: [PATCH] =?UTF-8?q?Weltkarte=20Klippen:=20Schraffierung,=20Zoom-ab?= =?UTF-8?q?h=C3=A4ngige=20Linienst=C3=A4rke,=20Wald-Stil?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Kliff-Bereiche: diagonale Schraffierung (45°, ~5.5px Abstand) im gleichen Grauton via gc.clip() auf die Marching-Squares-Pfade - Klippen- und Wald-Konturlinien: 1.2px bei Zoom 0-2, 2.5px bei Zoom 3, 3.5px bei Zoom 4 (deutlich dicker zum Reinzoomen) - Wald-Umrandung: selber Stil und Dicke wie Klippen, aber dunkelgrün (28/78/12) - Render-Reihenfolge bleibt: Klippen → Wasser → Wald Co-Authored-By: Claude Sonnet 4.6 --- .../de/blight/editor/ui/WorldMapView.java | 37 +++++++++++++++++-- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/blight-editor/src/main/java/de/blight/editor/ui/WorldMapView.java b/blight-editor/src/main/java/de/blight/editor/ui/WorldMapView.java index 2cff726..8952c16 100644 --- a/blight-editor/src/main/java/de/blight/editor/ui/WorldMapView.java +++ b/blight-editor/src/main/java/de/blight/editor/ui/WorldMapView.java @@ -557,6 +557,15 @@ public class WorldMapView extends VBox { return (v00*(1-tx)+v10*tx)*(1-tz)+(v01*(1-tx)+v11*tx)*tz; } + /** Linienstärke für Klippen- und Wald-Konturen – steigt bei hohem Zoom deutlich an. */ + private double overlayLineWidth() { + return switch (zoomLevelIdx) { + case 3 -> 2.5; + case 4 -> 3.5; + default -> 1.2; + }; + } + private void drawForestOverlay(GraphicsContext gc) { double cW = canvas.getWidth(), cH = canvas.getHeight(); if (bakedForestOverlay != null) { @@ -564,8 +573,8 @@ public class WorldMapView extends VBox { } if (!forestPaths.isEmpty()) { gc.save(); - gc.setStroke(Color.rgb(45, 99, 22, 0.85)); - gc.setLineWidth(Math.max(1.0, 1.5 / scale)); + gc.setStroke(Color.rgb(28, 78, 12, 0.88)); + gc.setLineWidth(overlayLineWidth()); gc.setLineDashes(); for (float[][] path : forestPaths) { drawCoastPath(gc, path, cW, cH, 8); @@ -580,9 +589,31 @@ public class WorldMapView extends VBox { gc.drawImage(bakedCliffOverlay, -panX / scale, -panY / scale, cW / scale, cH / scale, 0, 0, cW, cH); } if (!cliffPaths.isEmpty()) { + // Schraffierung: diagonale Linien, geclippt auf Kliff-Bereiche + gc.save(); + gc.beginPath(); + for (float[][] path : cliffPaths) { + if (path.length < 2) { continue; } + gc.moveTo(toCanvasX(path[0][0]), toCanvasZ(path[0][1])); + for (int i = 1; i < path.length; i++) { + gc.lineTo(toCanvasX(path[i][0]), toCanvasZ(path[i][1])); + } + gc.closePath(); + } + gc.clip(); + gc.setStroke(Color.rgb(120, 115, 115, 0.45)); + gc.setLineWidth(0.8); + gc.setLineDashes(); + double hatchSpacing = 5.5; + for (double d = -cH; d < cW + cH; d += hatchSpacing) { + gc.strokeLine(d, 0, d + cH, cH); + } + gc.restore(); + + // Konturlinie gc.save(); gc.setStroke(Color.rgb(80, 72, 72, 0.80)); - gc.setLineWidth(Math.max(1.0, 1.5 / scale)); + gc.setLineWidth(overlayLineWidth()); gc.setLineDashes(); for (float[][] path : cliffPaths) { drawCoastPath(gc, path, cW, cH, 8);