Fix editor tests

This commit is contained in:
Antonio Scandurra 2024-01-12 14:50:42 +01:00
parent 94293b3bf9
commit a32ad3f907
2 changed files with 38 additions and 32 deletions

View file

@ -2004,11 +2004,9 @@ impl<'a> WindowContext<'a> {
result
}
pub(crate) fn with_view_id<R>(
&mut self,
view_id: EntityId,
f: impl FnOnce(&mut Self) -> R,
) -> R {
/// Invoke the given function with the given view id present on the view stack.
/// This is a fairly low-level method used to layout views.
pub fn with_view_id<R>(&mut self, view_id: EntityId, f: impl FnOnce(&mut Self) -> R) -> R {
let text_system = self.text_system().clone();
text_system.with_view(view_id, || {
self.window.next_frame.view_stack.push(view_id);
@ -2018,7 +2016,9 @@ impl<'a> WindowContext<'a> {
})
}
pub(crate) fn paint_view<R>(&mut self, view_id: EntityId, f: impl FnOnce(&mut Self) -> R) -> R {
/// Invoke the given function with the given view id present on the view stack.
/// This is a fairly low-level method used to paint views.
pub fn paint_view<R>(&mut self, view_id: EntityId, f: impl FnOnce(&mut Self) -> R) -> R {
self.with_view_id(view_id, |cx| {
cx.window
.next_frame