mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-26 10:47:11 -06:00
Typing with an input method (the macOS Japanese IME and the like) used to insert the raw keys (romaji came in as ASCII): egui's Ime events weren't handled. - Tools gain `ime_preedit` / `composing` / `ime_caret`; the Type tool lays the marked text out in place inside its typing session, underlined (the clause being converted thicker), and commits it through `text_input`. Character ranges from the IME convert to byte ranges in one place. A cancelled composition leaves no empty undo step; an empty clear with nothing marked never deletes the selection. - The UI sends Text and Ime events to the tool in order, sends IMEOutput every frame while text is edited (what lets egui-winit enable the IME and place its candidate window at the caret, or the converting clause), and holds back keys, Enter/Escape, clipboard, single-key shortcuts and menu commands (Undo, Cut, Select All… also from the native menu) while composing. A click, a tool switch or a style change ends the composition with the marked text kept as typed; on macOS the IME is told to discard it (NSTextInputContext.discardMarkedText) so it doesn't come back in the next input. - Undo during a typing session also ends the Type tool's session, so its caret and marked text follow the document. - Tests: tools (char → byte ranges, underlines and candidate position), engine (compose → commit is one step, cancel leaves no step, a click commits, Undo mid-composition is safe), ui-egui (synthetic Ime events: compose, commit, ⌘Z held back, IME output, click and app switch). Checked by hand on macOS 27 with the Japanese IME (romaji input, convert, commit, cancel, Undo/Redo after commit, click away, Latin mode, app switch). Not checked: Windows and Linux IMEs, the web build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
39 lines
1.2 KiB
TOML
39 lines
1.2 KiB
TOML
[package]
|
|
name = "vectorcraft"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
publish = false
|
|
default-run = "vectorcraft"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
vectorcraft-engine = { workspace = true }
|
|
vectorcraft-ui-egui = { workspace = true }
|
|
eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit", "wayland", "x11"] }
|
|
egui = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
log = { workspace = true }
|
|
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
|
rfd = { workspace = true }
|
|
arboard = { workspace = true, features = ["image-data"] }
|
|
image = { workspace = true }
|
|
webbrowser = { workspace = true }
|
|
# The window's monitors, size and position (the same winit eframe runs on).
|
|
winit = { version = "0.30", default-features = false }
|
|
|
|
[target.'cfg(windows)'.dependencies]
|
|
clipboard-win = { workspace = true }
|
|
|
|
[target.'cfg(target_os = "macos")'.dependencies]
|
|
muda = { version = "0.21", default-features = false }
|
|
objc2 = "0.6"
|
|
objc2-app-kit = { version = "0.3", default-features = false, features = ["std", "NSTextInputContext"] }
|
|
|
|
[build-dependencies]
|
|
# Icon + VERSIONINFO for vectorcraft.exe; build.rs only uses it when targeting Windows.
|
|
winresource = "0.1"
|