cad-editor/src/scene
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Hakan Seven 970ee5a09f fix(blocks): layer-0 children inherit the block instance layer (#221)
Entities inside a block definition that sit on layer "0" must take on the
properties of the layer the block reference is inserted on; every other
layer is "sticky" and keeps its own identity. OpenCADStudio resolved a
block child's ByLayer color/linetype/lineweight against the child's own
layer in all cases, so layer-0 content stayed layer-0 (white) instead of
inheriting the instance layer.

Resolution now follows the standard rule for block children — explicit
wins, then ByBlock → the insert's own style, then layer-0 + ByLayer →
the insert's *layer* style, else the child's own layer. The insert's
layer style threads through the whole block-expansion chain (and chains
correctly through nested inserts), with the child's own transparency
preserved.

Covered across every block-render path:
- wires (line/arc/circle/polyline/text) via the block cache + the
  explode fallback + insert attributes
- hatch / solid fills (also fixes the PDF/print export path)
- 3D solid block children (per-instance mesh recolor)
- Dimension / Table baked-block sub-entities

New shared helpers in scene::view::render: InheritStyle, layer_render_style,
lineweight_to_px; render_style_for_block_sub gained the layer-0 branch.
Adds unit tests covering the layer-0, sticky-layer, ByBlock, explicit and
transparency cases.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 17:24:04 +03:00
..
cache fix(blocks): layer-0 children inherit the block instance layer (#221) 2026-06-30 17:24:04 +03:00
convert fix(blocks): layer-0 children inherit the block instance layer (#221) 2026-06-30 17:24:04 +03:00
model refactor: move resource/IO root modules under io/ 2026-06-26 23:06:40 +03:00
pick feat(viewport): RMB 1st=Enter, 2nd=menu (no setting) 2026-06-27 16:32:40 +03:00
pipeline refactor(viewport): migrate model-space tiling to iced pane_grid 2026-06-27 11:50:11 +03:00
text fix(block-cache): address PR211 review follow-ups 2026-06-28 21:57:51 +03:00
view fix(blocks): layer-0 children inherit the block instance layer (#221) 2026-06-30 17:24:04 +03:00
camera_ops.rs fix(view): drop non-standard camera View record; restore from VPORT 2026-06-27 19:27:23 +03:00
entity.rs fix(blocks): layer-0 children inherit the block instance layer (#221) 2026-06-30 17:24:04 +03:00
group_layer.rs refactor: split four oversized files into submodule trees 2026-06-26 22:51:29 +03:00
layout.rs refactor(viewport): migrate model-space tiling to iced pane_grid 2026-06-27 11:50:11 +03:00
mod.rs fix(blocks): layer-0 children inherit the block instance layer (#221) 2026-06-30 17:24:04 +03:00
modify.rs refactor: split four oversized files into submodule trees 2026-06-26 22:51:29 +03:00
mspace.rs refactor: split four oversized files into submodule trees 2026-06-26 22:51:29 +03:00
paper.rs refactor: split four oversized files into submodule trees 2026-06-26 22:51:29 +03:00
preview.rs refactor: split four oversized files into submodule trees 2026-06-26 22:51:29 +03:00
project.rs refactor: split four oversized files into submodule trees 2026-06-26 22:51:29 +03:00
selection.rs refactor: split four oversized files into submodule trees 2026-06-26 22:51:29 +03:00