mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-29 17:55:45 +01:00
ui-contract: a repaint request's cause names its caller
repaint::request and request_of are #[track_caller], so egui's repaint causes name the component that asked, not the wrapper: how the hover fades that keep frames running were found (photocraft#17148). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bd2e084232
commit
cbcc2ffbdb
1 file changed
+4
-2
@@ -2,13 +2,15 @@
|
||||
|
||||
use egui::Context;
|
||||
|
||||
/// Asks for one more pass after this one.
|
||||
/// Asks for one more pass after this one. The repaint cause names the caller.
|
||||
#[track_caller]
|
||||
pub(crate) fn request(ctx: &Context) {
|
||||
crate::runtime::replay::note_unsettled(ctx);
|
||||
ctx.request_repaint();
|
||||
}
|
||||
|
||||
/// Asks for a pass of `viewport` at once.
|
||||
/// Asks for a pass of `viewport` at once. The repaint cause names the caller.
|
||||
#[track_caller]
|
||||
pub(crate) fn request_of(ctx: &Context, viewport: egui::ViewportId) {
|
||||
crate::runtime::replay::note_unsettled(ctx);
|
||||
ctx.request_repaint_of(viewport);
|
||||
|
||||
Reference in new issue
Block a user