mirror of
https://github.com/storytold/wordcraft.git
synced 2026-12-06 23:09:47 +00:00
Caret: no blink-timer wakeups while a selection hides the caret (#9770)
The 530 ms blink repaint was scheduled whenever the editor had focus, including when a text selection hides the caret, so an idle window with text selected redrew about twice a second for nothing. Claude-Session: https://claude.ai/code/session_01FypgCXNomWeGUu3duixKdm Co-authored-by: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
b66f352171
commit
eaf8c8256c
@@ -214,7 +214,7 @@ pub(crate) fn paint_caret(app: &mut WordApp, ui: &mut Ui, pass: &ToolPass, body:
|
||||
ctx.request_repaint();
|
||||
} else if shown && animates(app, motion) && blink_fading(since_ms / 1000.0, app.canvas.glide.secs()) {
|
||||
ctx.request_repaint_after(std::time::Duration::from_millis(16));
|
||||
} else if active {
|
||||
} else if shown {
|
||||
ctx.request_repaint_after(std::time::Duration::from_millis(530 - (since_ms as u64 % 530)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user