forked from 1b-agent/opencadstudio-upstream
fix(clipboard): paste anchor at bounding-box lower-left, not center (#285)
COPYCLIP/CUTCLIP used the mean of each entity's bounding-box centre as the paste anchor. Standard clipboard behaviour puts the lower-left corner of the box enclosing all copied items under the cursor. Union each entity's bbox min corner instead, and rename clipboard_centroid -> clipboard_base (COPYBASE also stores a picked point there, so "centroid" was inaccurate). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
f5870b011d
commit
c249a99d4c
6 files changed
+40
-38
No files matched your search
@@ -790,7 +790,7 @@ impl OpenCADStudio {
|
||||
if self.clipboard.is_empty() {
|
||||
self.command_line.push_error("Clipboard is empty.");
|
||||
} else {
|
||||
let delta = base_pt - self.clipboard_centroid;
|
||||
let delta = base_pt - self.clipboard_base;
|
||||
let translate = crate::command::EntityTransform::Translate(delta);
|
||||
self.push_undo_snapshot(i, "PASTECLIP");
|
||||
let count = self.clipboard.len();
|
||||
|
||||
Reference in new issue
Block a user