forked from 1b-agent/opencadstudio-upstream
fix(sheetset): read drawings off the UI thread
The wizard's folder scan, Import Layout as Sheet, the template layout lists and the drawing cache behind Model Views, Place on Sheet, callout / label blocks and block previews parsed whole DWGs on the UI thread. They now go through the shared `background_task` worker: a cache miss reads the drawing and handles the message that needed it again. Block previews lend the cached drawing to the preview scene instead of cloning it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
40847d72a1
commit
3a5c1dbb7d
4 files changed
+305
-153
No files matched your search
@@ -40,7 +40,7 @@ fn write_export(path: &std::path::Path, bytes: &[u8]) -> Result<(), String> {
|
||||
/// reaches the UI thread: it is caught on the worker and re-surfaced as
|
||||
/// [`Message::BackgroundTaskFailed`] so a crashing export or import reports
|
||||
/// on the command line instead of killing the application.
|
||||
pub(super) fn background_task<T, F, M>(context: impl Into<String>, work: F, map: M) -> Task<Message>
|
||||
pub(in crate::app) fn background_task<T, F, M>(context: impl Into<String>, work: F, map: M) -> Task<Message>
|
||||
where
|
||||
T: Send + 'static,
|
||||
F: FnOnce() -> T + Send + 'static,
|
||||
|
||||
@@ -96,6 +96,7 @@ mod blocks_palette;
|
||||
mod dialog;
|
||||
mod dynamic;
|
||||
mod file;
|
||||
pub(in crate::app) use file::background_task;
|
||||
mod page_setup_import;
|
||||
mod style;
|
||||
pub(in crate::app) mod util;
|
||||
|
||||
Reference in new issue
Block a user