forked from 1b-agent/opencadstudio-upstream
perf(wire): move LWDISPLAY toggle from CPU rebake to wire shader uniform
LWDISPLAY (Show Lineweight) flipping the toggle no longer triggers a full retessellate. `render_style_for` always bakes the entity's resolved (layer- inherited) lineweight, and the wire shader reads `Uniforms.lwdisplay_enable` to either honour the per-vertex half_width or collapse the quad to a 1 px line. Side effect: PDF export now uses the real lineweight regardless of LWDISPLAY, matching AutoCAD's plot semantics (LWDISPLAY only affects screen render). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
1 parent
fb3dd58d09
commit
e9488f99dd
5 files changed
+38
-33
No files matched your search
+1
-1
@@ -4522,7 +4522,7 @@ impl H7CAD {
|
||||
Ok(Some(v)) => {
|
||||
self.push_undo_snapshot(i, "LWDISPLAY");
|
||||
self.tabs[i].scene.document.header.lineweight_display = v;
|
||||
self.tabs[i].scene.bump_geometry();
|
||||
// No retessellate — the wire shader honours the flag via uniforms.
|
||||
self.tabs[i].dirty = true;
|
||||
self.command_line.push_output(&format!(
|
||||
"LWDISPLAY {}",
|
||||
|
||||
+1
-1
@@ -2514,7 +2514,7 @@ impl H7CAD {
|
||||
if i < self.tabs.len() {
|
||||
let h = &mut self.tabs[i].scene.document.header;
|
||||
h.lineweight_display = !h.lineweight_display;
|
||||
self.tabs[i].scene.bump_geometry();
|
||||
// No retessellate — the wire shader reads the flag from uniforms.
|
||||
self.tabs[i].dirty = true;
|
||||
}
|
||||
Task::none()
|
||||
|
||||
Reference in new issue
Block a user