diff --git a/PlotLine/ViewModels/CoreViewModels.cs b/PlotLine/ViewModels/CoreViewModels.cs index 543a098..0a1de89 100644 --- a/PlotLine/ViewModels/CoreViewModels.cs +++ b/PlotLine/ViewModels/CoreViewModels.cs @@ -1938,6 +1938,8 @@ public sealed class FloorPlanBlockEditViewModel [Required, StringLength(40)] public string BlockType { get; set; } = FloorPlanBlockTypes.Room; + // Future L-shape support should add ShapeType, FootWidthCells, FootHeightCells, and CornerPosition + // only when the database, save/load flow, rendering, and collision checks can move together. [StringLength(200)] public string? LabelOverride { get; set; } diff --git a/PlotLine/Views/FloorPlans/Edit.cshtml b/PlotLine/Views/FloorPlans/Edit.cshtml index daecead..faae363 100644 --- a/PlotLine/Views/FloorPlans/Edit.cshtml +++ b/PlotLine/Views/FloorPlans/Edit.cshtml @@ -5,7 +5,7 @@ var activeFloor = Model.Floors.OrderBy(x => x.SortOrder).ThenBy(x => x.Name).FirstOrDefault(); var blocksByFloor = Model.Blocks.GroupBy(x => x.FloorPlanFloorID).ToDictionary(x => x.Key, x => x.ToList()); var transitionsByFloor = Model.Transitions.GroupBy(x => x.FloorPlanFloorID).ToDictionary(x => x.Key, x => x.ToList()); - var selectedBlockId = int.TryParse(Context.Request.Query["selectedBlockId"], out var parsedSelectedBlockId) ? parsedSelectedBlockId : Model.Blocks.FirstOrDefault()?.FloorPlanBlockID ?? 0; + 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; @@ -1364,7 +1364,7 @@ else addBlockModes.forEach(input => input.addEventListener("change", updateAddBlockMode)); updateAddBlockMode(); - const initialBlock = blocks.find(block => block.dataset.block === initialSelectedBlockId) || blocks[0]; + const initialBlock = blocks.find(block => block.dataset.block === initialSelectedBlockId); if (initialBlock) { setActiveFloor(initialBlock.dataset.floorId); selectBlock(initialBlock);