Höhlenkarte: Overlay-Darstellung identisch zur Weltkarte

- 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 <noreply@anthropic.com>
This commit is contained in:
2026-09-06 22:03:28 +02:00
parent a0b1e09d7d
commit 6e7e94371e

View File

@@ -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();
}