1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 06:10:06 -04:00

egui and eframe now uses more ViewportIdPair

This commit is contained in:
Konkitoman
2023-09-26 00:05:04 +03:00
parent 28f7b863fe
commit e453d667e5
7 changed files with 110 additions and 175 deletions

View File

@@ -19,7 +19,7 @@ pub mod easy_mark;
pub use color_test::ColorTest;
pub use demo::DemoWindows;
#[cfg(test)]
use egui::ViewportId;
use egui::ViewportIdPair;
/// View some Rust code with syntax highlighting and selection.
pub(crate) fn rust_view_ui(ui: &mut egui::Ui, code: &str) {
@@ -76,14 +76,9 @@ fn test_egui_e2e() {
const NUM_FRAMES: usize = 5;
for _ in 0..NUM_FRAMES {
let full_output = ctx.run(
raw_input.clone(),
ViewportId::MAIN,
ViewportId::MAIN,
|ctx| {
demo_windows.ui(ctx);
},
);
let full_output = ctx.run(raw_input.clone(), ViewportIdPair::MAIN, |ctx| {
demo_windows.ui(ctx);
});
let clipped_primitives = ctx.tessellate(full_output.shapes);
assert!(!clipped_primitives.is_empty());
}
@@ -100,14 +95,9 @@ fn test_egui_zero_window_size() {
const NUM_FRAMES: usize = 5;
for _ in 0..NUM_FRAMES {
let full_output = ctx.run(
raw_input.clone(),
ViewportId::MAIN,
ViewportId::MAIN,
|ctx| {
demo_windows.ui(ctx);
},
);
let full_output = ctx.run(raw_input.clone(), ViewportIdPair::MAIN, |ctx| {
demo_windows.ui(ctx);
});
let clipped_primitives = ctx.tessellate(full_output.shapes);
assert!(
clipped_primitives.is_empty(),