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

Move App::persist_window to NativeOptions and App::max_size_points to WebOptions (#3397)

* Move `App::persist_window` to `NativeOptions`

* Move `App::max_size_points` to `WebOptions`

* Build fixes
This commit is contained in:
Emil Ernerfeldt
2023-09-27 08:48:48 +02:00
committed by GitHub
parent 1b18f8e266
commit b3e19f5b7d
3 changed files with 21 additions and 15 deletions

View File

@@ -6,6 +6,7 @@ use crate::{epi, App};
use super::{now_sec, web_painter::WebPainter, NeedRepaint};
pub struct AppRunner {
web_options: crate::WebOptions,
pub(crate) frame: epi::Frame,
egui_ctx: egui::Context,
painter: super::ActiveWebPainter,
@@ -98,6 +99,7 @@ impl AppRunner {
}
let mut runner = Self {
web_options,
frame,
egui_ctx,
painter,
@@ -174,7 +176,7 @@ impl AppRunner {
pub fn logic(&mut self) -> (std::time::Duration, Vec<egui::ClippedPrimitive>) {
let frame_start = now_sec();
super::resize_canvas_to_screen_size(self.canvas_id(), self.app.max_size_points());
super::resize_canvas_to_screen_size(self.canvas_id(), self.web_options.max_size_points);
let canvas_size = super::canvas_size_in_points(self.canvas_id());
let raw_input = self.input.new_frame(canvas_size);