refactor: share duplicated fill, cache, settings and toggle code

- fill_plate and fill_area share one MCP fill helper
- FillLinear uses FillHelpers.HasOverlappingParts
- BestFitCache and FillResultCache entries derive from DrawingCacheEntry
- NestDefaults and ClampSettings read through SettingsFile.TryReadText
- MainForm view toggles share one ToggleView handler

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ajandClaude Opus 5.5 committed 2026-11-29 09:47:29 -05:00
1 parent 4b61d249c0
commit d77693aaff
10 files changed
+178 -217

No files matched your search

+4 -15
View File
@@ -102,22 +102,11 @@ public sealed class NestDefaults
out NestDefaultsStatus status
)
{
if (string.IsNullOrWhiteSpace(path) || !File.Exists(path))
// A file that exists but cannot be read (locked, access-denied)
// must never block creating a nest.
if (!SettingsFile.TryReadText(path, out var json, out var missing))
{
status = NestDefaultsStatus.Missing;
return WithUnits(Fallback, fallbackUnits);
}
string json;
try
{
json = File.ReadAllText(path);
}
catch (Exception ex) when (SettingsFile.IsUnreadableFile(ex))
{
// A file that exists but cannot be read (locked, access-denied)
// must never block creating a nest.
status = NestDefaultsStatus.Invalid;
status = missing ? NestDefaultsStatus.Missing : NestDefaultsStatus.Invalid;
return WithUnits(Fallback, fallbackUnits);
}
return Parse(json, fallbackUnits, out status);