Conversation
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.
Summary
Why
isByLayerColorwhile still being logically ByLayer, causing incorrect inherited color behavior.isByLayerflag was too coarse for correctly applying inherited updates across color, linetype, lineweight, and transparency.What Changed
packages/cad-simple-viewer/src/view/AcTrView2d.tsnow remaps inherited block materials viagetLayerBoundMaterial, resolves effective layer traits, and promotes layer-0 color binding when other ByLayer bindings are present.packages/three-renderer/src/renderer/AcTrRenderer.tsandpackages/three-renderer/src/style/AcTrStyleManager.tsreplaceremapMaterialLayerwithgetLayerBoundMaterial(material, layerName, layerTraits?).packages/three-renderer/src/style/AcTrMaterialManager.tsnow applies inherited layer traits only for flagged ByLayer attributes and stores/reads granular metadata flags.packages/three-renderer/src/style/AcTrMaterialMetadata.tsadds typed metadata helpers (getMaterialMetadata,setMaterialMetadata,hasByLayerBinding), exported viapackages/three-renderer/src/index.ts.packages/three-renderer/__tests__/AcTrStyleManager.spec.tsupdates remap tests and adds a case that refreshes ByLayer color even when target layer is unchanged.packages/cad-viewer-example/e2e/tests/smoke.spec.tsadds a regression test using new fixturepackages/cad-viewer-example/e2e/fixtures/block-color.dxfand snapshotblock-layer0-bylayer-inherit-chromium-win32.png.main..fix/219) also includes broader issue layer color change not applied to all entities in the same layer #219 refactors across viewer/renderer/layer UI files plus dependency/lockfile adjustments.Risks / Notes
material.userData.isByLayermay need migration to granular flags.remapMaterialLayermust migrate togetLayerBoundMaterial.Breaking Changes
AcTrRenderer/AcTrStyleManagerlayer-remap API renamed fromremapMaterialLayertogetLayerBoundMaterial.isByLayerColor,isByLayerLineType,isByLayerLineWeight, andisByLayerTransparencyinstead of a singleisByLayer.