1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 22:00:03 -04:00

Now viewport_id always will be in a ViewportId you cannot create a ViewportId you can only get the main one everywere or get the current viewport id with Context::get_viewport_id

This commit is contained in:
Konkitoman
2023-08-09 18:33:59 +03:00
parent 1a7c4700fd
commit 86ef11c521
34 changed files with 775 additions and 663 deletions

View File

@@ -19,6 +19,7 @@ pub mod syntax_highlighting;
pub use color_test::ColorTest;
pub use demo::DemoWindows;
use egui::ViewportId;
// ----------------------------------------------------------------------------
@@ -68,9 +69,14 @@ fn test_egui_e2e() {
const NUM_FRAMES: usize = 5;
for _ in 0..NUM_FRAMES {
let full_output = ctx.run(raw_input.clone(), 0, 0, |ctx| {
demo_windows.ui(ctx);
});
let full_output = ctx.run(
raw_input.clone(),
ViewportId::MAIN,
ViewportId::MAIN,
|ctx| {
demo_windows.ui(ctx);
},
);
let clipped_primitives = ctx.tessellate(full_output.shapes);
assert!(!clipped_primitives.is_empty());
}
@@ -87,9 +93,14 @@ fn test_egui_zero_window_size() {
const NUM_FRAMES: usize = 5;
for _ in 0..NUM_FRAMES {
let full_output = ctx.run(raw_input.clone(), 0, 0, |ctx| {
demo_windows.ui(ctx);
});
let full_output = ctx.run(
raw_input.clone(),
ViewportId::MAIN,
ViewportId::MAIN,
|ctx| {
demo_windows.ui(ctx);
},
);
let clipped_primitives = ctx.tessellate(full_output.shapes);
assert!(
clipped_primitives.is_empty(),