Repository navigation
fix(annotations): dimension lines from other editors keep their look - #528
Merged
Merged
Conversation
Dimension lines (/Line /IT /LineDimension) from other programs were read into the app's own measure style and lost most of their properties; saving then wrote that style back, so other viewers showed the changed version too. Now taken over, and kept over load and save through OPS keys: - line width 1 when neither /BS nor /Border is given (also plain lines and arrows); - hollow closed arrowheads when there is no /IC, at the size the file uses; - leader lines from /LL, /LLE and /LLO, without the app's own overshoot; - the caption inside the line (/CP /Inline, also the default for /Cap without /CP), with font size and colour from /RC; - short dimensions with the arrowheads outside the leader lines; - near-vertical dimensions read from bottom to top. Files saved by Open PDF Studio itself and floor-plan measures load and save as before.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What happened
A structural overview drawing whose annotations were made in another editor looked different in Open PDF Studio. Its dimension lines (
/Line /IT /LineDimensionwith/LL,/LLE,/Cap,/CP /Inline,/LE [/ClosedArrow /ClosedArrow], no/IC, no/BS) were read into the app's own measure style, which:/BSand/Borderare missing; the PDF default is 1);/ICthey are hollow) and made them 12 pt instead of the file's size;/LLEand/LLO;/RC;Saving then wrote that style back, so after one save other viewers showed the changed version as well.
What this changes
js/pdf/loader/maatlijn-uit-bestand.jsmaps a foreign dimension line to the model per key, only from what the dict contains: width 1 without/BS//Border, hollow closed heads without/IC, head size from the file,/LL//LLE//LLO, inline caption for/CP /Inline(and for/Capwithout/CP, the PDF default), caption font size and colour from/RC.decorations.js), inline caption with a gap in the line (maatlijn-inline.js,maat-inline-tekenen.js), arrowheads outside the leader lines when the caption does not fit, a 1° tolerance before a near-vertical caption flips.js/pdf/saver/maatlijn-opslaan.js): writes the appearance accordingly and keeps every taken-over property throughOPS_HeadFill,OPS_DimTextPos,OPS_FontSizeandOPS_LabelColor, so it survives load, save and load again./BS, and to the perimeter measure branch.Unchanged
Files saved by Open PDF Studio itself and floor-plan measures: their saved dictionaries and appearances are compared with fixed output of the previous code (
maatlijn-eigen-opslag.json) and are identical. Older own measures (from beforeOPS_Subtypeexisted) now draw at the PDF default width of 1 pt instead of 0.5 pt; a test records this.Verification
npm run test:unit2633 passed, 0 failed;npx vite buildandnpm run typecheckgreen./Capwithout/CPnot inline); all fixed test-first.🤖 Generated with Claude Code