Merge pull request #1696 from YsDirector/pr/c11-next-frame

Capture after the next rendered frame

# Conflicts:
#	src/app/control/mod.rs
This commit is contained in:
Hakan Seven committed 2026-10-11 23:30:20 +03:00
commit 7b8397fe6b
4 files changed
+129 -15

No files matched your search

+13
View File
@@ -2603,6 +2603,18 @@ impl OpenCADStudio {
} else {
Subscription::none()
};
// C11: park a `capture` request until the window draws another frame;
// a timer fallback prevents a request from hanging when no redraw is
// pending.
let capture_frame = if self.control.capture_frame_pending {
Subscription::batch([
window::frames().map(|_| Message::ControlCaptureFrame { redrew: true }),
iced::time::every(std::time::Duration::from_millis(50))
.map(|_| Message::ControlCaptureFrame { redrew: false }),
])
} else {
Subscription::none()
};
// Blink the MText preview caret while the editor is open.
let caret_blink = if self.mtext_editor.is_some() {
iced::time::every(std::time::Duration::from_millis(530))
@@ -2858,6 +2870,7 @@ impl OpenCADStudio {
nav_settle,
gpu_probe,
thumbnail_capture,
capture_frame,
caret_blink,
web_fonts,
autosave,