From 7bcc6d0598146e050f9a811a0123b2269daf8f3f Mon Sep 17 00:00:00 2001 From: Nick Beckley Date: Sun, 21 Jun 2026 19:17:30 +0100 Subject: [PATCH] Implemented the narrower same-location wall merge. --- PlotLine/Views/FloorPlans/Edit.cshtml | 118 +++++++++++++++++--------- PlotLine/wwwroot/css/site.css | 64 ++++++++------ PlotLine/wwwroot/css/site.min.css | 2 +- 3 files changed, 117 insertions(+), 67 deletions(-) diff --git a/PlotLine/Views/FloorPlans/Edit.cshtml b/PlotLine/Views/FloorPlans/Edit.cshtml index 39e0d6c..5b32a48 100644 --- a/PlotLine/Views/FloorPlans/Edit.cshtml +++ b/PlotLine/Views/FloorPlans/Edit.cshtml @@ -8,37 +8,6 @@ var selectedBlockId = int.TryParse(Context.Request.Query["selectedBlockId"], out var parsedSelectedBlockId) ? parsedSelectedBlockId : 0; string BlockClass(string blockType) => $"floor-plan-block floor-plan-block--{blockType.ToLowerInvariant()}"; string CssNumber(decimal value) => value.ToString("0.###", System.Globalization.CultureInfo.InvariantCulture); - bool RangesOverlap(int aStart, int aLength, int bStart, int bLength) => aStart < bStart + bLength && bStart < aStart + aLength; - string SharedWallClasses(FloorPlanBlockEditViewModel block, IReadOnlyList floorBlocks) - { - var classes = new List(); - foreach (var other in floorBlocks) - { - if (other.FloorPlanBlockID == block.FloorPlanBlockID || other.LocationID != block.LocationID) - { - continue; - } - - if (block.X + block.WidthCells == other.X && RangesOverlap(block.Y, block.HeightCells, other.Y, other.HeightCells)) - { - classes.Add("merge-east"); - } - if (other.X + other.WidthCells == block.X && RangesOverlap(block.Y, block.HeightCells, other.Y, other.HeightCells)) - { - classes.Add("merge-west"); - } - if (block.Y + block.HeightCells == other.Y && RangesOverlap(block.X, block.WidthCells, other.X, other.WidthCells)) - { - classes.Add("merge-south"); - } - if (other.Y + other.HeightCells == block.Y && RangesOverlap(block.X, block.WidthCells, other.X, other.WidthCells)) - { - classes.Add("merge-north"); - } - } - - return string.Join(" ", classes.Distinct()); - } string TransitionDetails(FloorPlanTransitionEditViewModel transition) { var details = $"{transition.FromLocationName} -> {transition.ToLocationName}\n{transition.TransitionType}"; @@ -186,7 +155,7 @@ { var blockIndex = Model.Blocks.FindIndex(x => x.FloorPlanBlockID == block.FloorPlanBlockID);