You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mdl: saving a multi-view file gives every view the first view's font #405
Each view in an MDL sketch has its own $... line giving its font and default colors.
The reader merges all views into one diagram and keeps only the first view's line, so saving a multi-view file writes that line on every view.
Example
test/metasd/WRLD3-03/wrld3-03.mdl has 14 views: 3 use $192-192-192,0,|12||-1--1--1|0-0-0|0-0-255|... and 11 use ...|64-64-64|128-128-128|....
After a save, all 14 carry the first view's line, so 11 views change their default colors. mark2.mdl, the multi-view file the round-trip test uses, has the same line on both views, so the test does not see this.
Why it matters
Cosmetic, but it changes a real model's diagram on every save, and the save gates do not check it.
Fix
The reader already keeps one record per original view, SketchSegmentCompat (that view's coordinate offset), in datamodel.rs and in project_io.proto as View.SketchCompat.Segment.
Add an optional font to it, fill it per view in the reader, and have the writer prefer it over StockFlow.font.
That is one new protobuf field and no change to how views are merged.
Pointers
src/simlin-engine/src/mdl/view/convert.rs: the merge loop that keeps the first font (around line 393)
src/simlin-engine/src/mdl/writer.rs: split_view_on_groups, which gives every segment sf.font
changed the title [-]MDL roundtrip loses per-view font metadata in multi-view models[/-][+]mdl: saving a multi-view file gives every view the first view's font[/+]on Oct 12, 2026
Activity
[-]MDL roundtrip loses per-view font metadata in multi-view models[/-][+]mdl: saving a multi-view file gives every view the first view's font[/+]