Skip to content

Commit

Permalink
Fix/disable ios lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmerlin committed Aug 20, 2024
1 parent b2672f7 commit 89a6fc5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions crates/eframe/src/native/epi_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ use winit::event_loop::ActiveEventLoop;

use raw_window_handle::{HasDisplayHandle as _, HasWindowHandle as _};

use egui::{DeferredViewportUiCallback, NumExt as _, ViewportBuilder, ViewportId};
use egui::{DeferredViewportUiCallback, ViewportBuilder, ViewportId};
use egui_winit::{EventResponse, WindowSettings};

use crate::epi;

#[cfg_attr(target_os = "ios", allow(dead_code, unused_variables, unused_mut))]
pub fn viewport_builder(
egui_zoom_factor: f32,
event_loop: &ActiveEventLoop,
Expand Down Expand Up @@ -53,8 +54,10 @@ pub fn viewport_builder(

if clamp_size_to_monitor_size {
if let Some(initial_window_size) = viewport_builder.inner_size {
let initial_window_size = initial_window_size
.at_most(largest_monitor_point_size(egui_zoom_factor, event_loop));
let initial_window_size = egui::NumExt::at_most(
initial_window_size,
largest_monitor_point_size(egui_zoom_factor, event_loop),
);
viewport_builder = viewport_builder.with_inner_size(initial_window_size);
}
}
Expand Down Expand Up @@ -95,6 +98,7 @@ pub fn apply_window_settings(
}
}

#[cfg(not(target_os = "ios"))]
fn largest_monitor_point_size(egui_zoom_factor: f32, event_loop: &ActiveEventLoop) -> egui::Vec2 {
crate::profile_function!();

Expand Down

0 comments on commit 89a6fc5

Please sign in to comment.