mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-25 23:49:35 +00:00
craft-ui: a scroll region's noted view is a clip
The view of a scroll region cuts what lies outside it: a replay cut by the clip around it cuts the view as a run there does.
This commit is contained in:
@@ -86,7 +86,12 @@ pub(crate) struct ScrollRegion {
|
||||
#[cfg(feature = "testing")]
|
||||
pub(crate) fn note_scroll_region(ctx: &Context, view: Rect, content: Rect) {
|
||||
noted::with(ctx, |pass| pass.scrolls.push(ScrollRegion { view, content }));
|
||||
crate::runtime::replay::journal(ctx, || (view, content), |ctx, &(view, content)| note_scroll_region(ctx, view, content));
|
||||
// The view cuts what lies outside it, as a clip does: a replay cut by the clip around it cuts the view too.
|
||||
crate::runtime::replay::journal(
|
||||
ctx,
|
||||
|| (crate::runtime::Clip::new(view), content),
|
||||
|ctx, &(view, content)| note_scroll_region(ctx, view.rect(), content),
|
||||
);
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "testing"))]
|
||||
|
||||
Reference in New Issue
Block a user