red round 3 (fw-pages): fixes for fw-run-4 (runs/fw-run-4/fw-pages.md); committed by the lead

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Dylan M. Taylor
2026-11-18 09:16:40 -05:00
co-authored by Claude Opus 5.5
parent ca26f06558
commit 23a349bdda
3 changed files with 10 additions and 5 deletions
+1 -1
View File
@@ -102,7 +102,7 @@ impl<'a> SyncedViews<'a> {
self
}
/// Splits the room in two halves (`SplitViews`, its divider and gap) and runs `half` for each, the leader first.
/// Splits the room in two halves (`SplitViews`, its divider on the boundary of the two panes) and runs `half` for each, the leader first.
/// With [`captions`](Self::captions) each half shows its caption band at its top and `half` gets the rect under it.
// pdfcraft: crates/ui-egui/src/workflows/compare_ui.rs:344 `compare_area`.
pub fn halves(
+1 -1
View File
@@ -761,7 +761,7 @@ fn run_pass(ui: &mut Ui, cx: &mut BodyCx<'_>, held: &mut Held<'_, PageViewState>
CanvasScrollbars::new(words.scroll_bars.clone(), Bind::given(shown), DocRect::from_origin_size(Point::ZERO, document)).show_at(ui, cx.rect);
let bar_drag = bars.view.value().is_some();
eprintln!(
"DIAG a_scroll_bar_drag_holds_the_sharp_renders_of_the_part_in_view_in_its_own_pass: bar_drag {bar_drag} travel {travel} pointer_zoom {pointer_zoom} events {:?}",
"DIAG a_scroll_bar_drag_holds_the_sharp_renders_of_the_part_in_view_in_its_own_pass: bar_drag {bar_drag} travel {travel} pointer_zoom {pointer_zoom} given {shown:?} events {:?}",
bars.view.events
);
if let Some(moved) = bars.view.value() {
+8 -3
View File
@@ -1,6 +1,5 @@
//! The synced pair: the caption band over each half and the room left to its view.
use craft_i18n::Direction;
use craft_pages::ui::fixtures::{DemoPages, PAPER};
use craft_pages::ui::{Lead, PageView, PageViewState, SyncedViews, SyncedViewsState};
@@ -45,7 +44,10 @@ fn captions_sit_over_each_half_and_the_view_takes_the_rest() {
// The left half reads first: on the left, or on the right in a right-to-left interface.
let ((first, first_view), (second, second_view)) = if rtl { ((new, new_view), (old, old_view)) } else { ((old, old_view), (new, new_view)) };
assert!(first_view.max.x < second_view.min.x, "the divider lies between the views ({direction:?}): {first_view:?} {second_view:?}");
assert!(
(first_view.max.x - second_view.min.x).abs() < 0.5,
"the divider sits at the boundary of the two contiguous views ({direction:?}): {first_view:?} {second_view:?}"
);
assert!(first.max.x <= second_view.min.x && second.min.x >= first_view.max.x, "the captions lie either side of the divider ({direction:?})");
for (name, caption, view) in [("Old", old, old_view), ("New", new, new_view)] {
@@ -53,7 +55,10 @@ fn captions_sit_over_each_half_and_the_view_takes_the_rest() {
assert!(caption.min.y >= room.min.y && caption.max.y <= view.min.y, "{name}'s caption sits above its view, clear of it ({direction:?})");
let band = view.min.y - room.min.y;
assert!(band > caption.height(), "{name}'s band pads its caption ({direction:?}): band {band}, caption {caption:?}");
assert!((band + view.height() - room.height()).abs() < 0.5, "{name}'s band and view share the room ({direction:?}): {view:?} in {room:?}");
assert!(
(band + view.height() - room.height()).abs() < 0.5,
"{name}'s band and view share the room ({direction:?}): {view:?} in {room:?}"
);
}
}
}