layer states: restore into the active layout viewport (#1796)

Restoring a layer state while a layout viewport is active now applies it
to that viewport alone, as viewport freezes and viewport overrides for
colour, linetype, lineweight and transparency (where they differ from the
layer, or an override is already there). On/off, lock and plot have no
per-viewport form and still apply to the drawing.

Viewport colour overrides are packed as the format does (0xC3 index,
0xC2 true colour); reading them now honours that type byte, so an index
override from a file no longer shows as a near-black true colour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-15 00:46:39 +03:00
1 parent 1d5b87d931
commit 7c3ec2666c
3 files changed
+158 -12

No files matched your search

+1 -5
View File
@@ -3799,11 +3799,7 @@ impl OpenCADStudio {
.map(|layer| layer.name.clone())
.collect();
self.push_undo_snapshot(i, "LAYERSTATE RESTORE");
let restored = self.tabs[i]
.scene
.document
.restore_layer_state(&name)
.unwrap_or(0);
let restored = self.restore_layer_state_here(i, &name);
let active = self.tabs[i]
.scene
.document