UPDATEFIELD: count fields as the reference does

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
ramox81andClaude Opus 5.5 committed 2026-10-07 10:24:35 +03:00
1 parent 7a8ec02003
commit 6da3fea563
2 files changed
+23 -18

No files matched your search

+5 -4
View File
@@ -3419,13 +3419,14 @@ impl Scene {
/// Update the fields an evaluation event re-evaluates (see
/// [`crate::entities::field::update_fields`]) and redraw the hosts whose
/// text changed. Returns the number of fields the hosts hold.
pub fn update_fields(&mut self, event: i32, hosts: Option<&[Handle]>) -> usize {
let changed = crate::entities::field::update_fields(&mut self.document, event, hosts).0;
/// text changed. Returns the number of hosts whose text changed and the
/// number of fields the hosts hold.
pub fn update_fields(&mut self, event: i32, hosts: Option<&[Handle]>) -> (usize, usize) {
let (changed, found) = crate::entities::field::update_fields(&mut self.document, event, hosts);
if !changed.is_empty() {
self.bump_text_hosts(&changed);
}
changed.len()
(changed.len(), found)
}
/// Redraw text hosts whose stored text changed (re-evaluated fields). An