forked from 1b-agent/opencadstudio-upstream
feat(clipboard): paste images from other programs on desktop too
A paste that finds no text now reads an image off the system clipboard on desktop as well as on the web. The pixels are written as a PNG beside the drawing (or in the config folder for a drawing never saved) and placed as a raster image at the cursor, the same way the web paste attaches a screenshot. PASTESPEC falls back to the same image paste when the clipboard holds neither objects nor text. Refs #645 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
d4b4fc37e1
commit
11f68a1185
4 files changed
+62
-33
No files matched your search
@@ -440,7 +440,6 @@ fn pasted_image_name(mime_type: &str) -> String {
|
||||
/// the candidate already names a registered source. The taken-check is
|
||||
/// injectable so this — the part worth locking with tests — runs natively;
|
||||
/// wasm passes [`crate::scene::model::image_model::has_source`].
|
||||
#[cfg_attr(not(target_arch = "wasm32"), allow(dead_code))] // tested everywhere, used on wasm
|
||||
pub(crate) fn unique_pasted_image_name(
|
||||
base: &str,
|
||||
ext: &str,
|
||||
|
||||
Reference in new issue
Block a user