forked from 1b-agent/opencadstudio-upstream
feat(draworder): cross-type draw order + context menu
DRAWORDER now affects rendering immediately (bump geometry epoch so the sort cache rebuilds) and front/back anchor to the block's full effective sort range instead of only existing table entries, so bring-to-front actually lands on top. The render fallback sorts table-absent entities by their own handle. Draw order now applies across entity types, not just within a type. A per-entity draw-order rank (SortEntitiesTable override or own handle, ranked per block) is encoded as a small signed clip-z bias in the wire, hatch, image, and 3DFACE pipelines. The shared LessEqual depth buffer then orders fills, lines, rasters and 2D solids against each other regardless of pass order — without touching model coordinates. 3D meshes keep real geometric depth; wipeouts stay always-on-top. Adds a Draw Order submenu to the viewport context menu (Bring to Front, Send to Back, Bring Above/Send Under Object). The above/under items run an interactive reference-object pick, then reorder the captured selection. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
14a981dc87
commit
09e7e90aae
19 files changed
+469
-36
No files matched your search
@@ -3006,6 +3006,7 @@ impl OpenCADStudio {
|
||||
if sel.right_down {
|
||||
if !sel.right_dragging {
|
||||
sel.context_menu = sel.last_move_pos;
|
||||
sel.draworder_submenu = false;
|
||||
}
|
||||
sel.right_down = false;
|
||||
sel.right_press_pos = None;
|
||||
@@ -3379,6 +3380,29 @@ impl OpenCADStudio {
|
||||
Task::none()
|
||||
}
|
||||
|
||||
Message::DrawOrderSubmenuToggle => {
|
||||
let i = self.active_tab;
|
||||
let mut sel = self.tabs[i].scene.selection.borrow_mut();
|
||||
sel.draworder_submenu = !sel.draworder_submenu;
|
||||
Task::none()
|
||||
}
|
||||
|
||||
Message::DrawOrderPickRef(above) => {
|
||||
let i = self.active_tab;
|
||||
self.tabs[i].scene.selection.borrow_mut().context_menu = None;
|
||||
let to_move: Vec<_> = self.tabs[i].scene.selected.iter().cloned().collect();
|
||||
if to_move.is_empty() {
|
||||
self.command_line
|
||||
.push_error("DRAWORDER: select entities first.");
|
||||
} else {
|
||||
use crate::command::CadCommand;
|
||||
let cmd = super::commands::DrawOrderRefCommand::new(to_move, above);
|
||||
self.command_line.push_info(&cmd.prompt());
|
||||
self.tabs[i].active_cmd = Some(Box::new(cmd));
|
||||
}
|
||||
Task::none()
|
||||
}
|
||||
|
||||
Message::SelectSimilar => {
|
||||
let i = self.active_tab;
|
||||
self.tabs[i].scene.selection.borrow_mut().context_menu = None;
|
||||
|
||||
Reference in new issue
Block a user