WIP: Start on rendering scenes via presenter

This commit is contained in:
Nathan Sobo
2021-03-18 21:33:16 -06:00
parent e809d6119a
commit 605bdd62dd
12 changed files with 495 additions and 388 deletions
+13 -11
View File
@@ -1269,7 +1269,7 @@ mod tests {
#[test]
fn test_selection_with_mouse() {
App::test(|mut app| async move {
App::test((), |mut app| async move {
let buffer = app.add_model(|_| Buffer::new(0, "aaaaaa\nbbbbbb\ncccccc\ndddddd\n"));
let settings = settings::channel(&FontCache::new()).unwrap().1;
let (_, buffer_view) =
@@ -1373,19 +1373,21 @@ mod tests {
let font_cache = FontCache::new();
let layout_cache = TextLayoutCache::new();
let mut app = App::new().unwrap();
let buffer = app.add_model(|_| Buffer::new(0, sample_text(6, 6)));
App::test((), |mut app| async move {
let buffer = app.add_model(|_| Buffer::new(0, sample_text(6, 6)));
let settings = settings::channel(&font_cache).unwrap().1;
let (_, view) = app.add_window(|ctx| BufferView::for_buffer(buffer.clone(), settings, ctx));
let settings = settings::channel(&font_cache).unwrap().1;
let (_, view) =
app.add_window(|ctx| BufferView::for_buffer(buffer.clone(), settings, ctx));
view.read(&app, |view, app| {
let layouts = view.layout_line_numbers(1000.0, &font_cache, &layout_cache, app)?;
assert_eq!(layouts.len(), 6);
Result::<()>::Ok(())
})?;
view.read(&app, |view, app| {
let layouts = view.layout_line_numbers(1000.0, &font_cache, &layout_cache, app)?;
assert_eq!(layouts.len(), 6);
Result::<()>::Ok(())
})?;
Ok(())
Ok(())
})
}
#[test]