ElyTable: clicks and drags land on the cell under them far down a sheet (R2.16)

This commit is contained in:
ZacharyZhang-NY committed 2026-10-09 02:04:13 -04:00
1 parent 148885248b
commit 0d529e1b0d
15 files changed
+297 -33

No files matched your search

+4 -1
View File
@@ -229,7 +229,10 @@ impl Book {
match read {
Ok((sheets, geometry, at)) => {
log::info!("table: tab {id} has {} sheets", sheets.list.len());
view.update(cx, |view, _| view.set_part(sheets.current));
view.update(cx, |view, cx| {
view.set_part(sheets.current);
view.set_geometry(geometry.clone(), cx);
});
let extra = &mut tab.extra;
extra.sheets = sheets;
extra.geometry = geometry;
+2 -2
View File
@@ -99,7 +99,7 @@ impl Book {
};
let length = if column { width } else { height };
let pick = |pair: (i32, i32)| if column { pair.0 } else { pair.1 };
let (frozen, scroll) = (pick(read.frozen()), pick(read.scroll()));
let (frozen, first) = (pick(read.frozen()), pick(read.scrolled_start()));
let mut spans = Vec::new();
let mut take = |index: u32| {
let (start, end) = (along(axis.start(index)), along(axis.start(index + 1)));
@@ -114,7 +114,7 @@ impl Book {
0
};
(0..held).for_each(&mut take);
let mut index = axis.at(frozen + scroll).max(held);
let mut index = axis.at(first).max(held);
while index < axis.count() && along(axis.start(index)) < length {
take(index);
index += 1;