mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-14 19:26:56 -04:00
A screenshot on the clipboard didn't paste everywhere: - macOS: the Paste menu item (which takes Cmd+V there) was enabled for text only, so with nothing copied in the app Cmd+V did nothing; and arboard reads the pasteboard's TIFF only. The pasteboard's types now enable Paste, and its PNG, else TIFF, pastes as it is. - Windows: bitmaps came through CF_BITMAP and GetDIBits, which drops alpha. Paste now reads PNG, else CF_DIBV5, else CF_DIB, decoded with their colour masks and tables (a BMP file header in front, which image's headerless decoder gets wrong for masks after a BITMAPINFOHEADER), opaque when the alpha is zero throughout as screenshots leave it, capped at 32768 px a side. - Web: only SVG text pasted. The page's paste event now hands the first picture or file that is art to the app (VectorcraftApp::paste_from_host), pasted with the chord held, like the desktop's paste keys. - Linux reads image/png already; its Paste menu item still waits for text (no cheap way to ask arboard for a bitmap), the paste keys take one. Bitmaps paste as embedded images at the view centre, as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
31 lines
1.1 KiB
TOML
31 lines
1.1 KiB
TOML
[package]
|
|
name = "vectorcraft-web"
|
|
description = "VectorCraft in the browser (eframe web runner, WebGPU with WebGL2 fallback)"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
publish = false
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[[bin]]
|
|
name = "vectorcraft-web"
|
|
path = "src/main.rs"
|
|
|
|
[dependencies]
|
|
vectorcraft-engine = { workspace = true }
|
|
vectorcraft-ui-egui = { workspace = true }
|
|
vectorcraft-format = { workspace = true }
|
|
egui = { workspace = true }
|
|
log = { workspace = true }
|
|
|
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
|
# `wgpu` pulls egui-wgpu's defaults: WebGPU plus the WebGL2 fallback.
|
|
eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] }
|
|
rfd = { workspace = true }
|
|
wasm-bindgen = "0.2"
|
|
wasm-bindgen-futures = "0.4"
|
|
js-sys = "0.3"
|
|
web-sys = { version = "0.3", features = ["Window", "Document", "Element", "HtmlElement", "HtmlCanvasElement", "HtmlIFrameElement", "HtmlAnchorElement", "Blob", "BlobPropertyBag", "ClipboardEvent", "DataTransfer", "File", "FileList", "Url", "Location", "CssStyleDeclaration", "Event", "EventTarget", "MouseEvent", "DragEvent", "Storage", "Navigator"] }
|