cad-editor/src/scene/view
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
..
camera.rs fix(viewcube): land face clicks upright, never upside-down 2026-06-26 00:11:40 +03:00
dispatch.rs refactor(scene): group modules into role-based subfolders 2026-06-16 11:33:46 +03:00
mod.rs refactor(scene): group modules into role-based subfolders 2026-06-16 11:33:46 +03:00
render.rs fix(blocks): layer-0 children inherit the block instance layer (#221) 2026-06-30 17:24:04 +03:00
transform.rs wip(f64): convert command layer to DVec3 (in progress) 2026-06-24 03:32:11 +03:00
viewport_pane.rs refactor(viewport): migrate model-space tiling to iced pane_grid 2026-06-27 11:50:11 +03:00