egui/crates/emath/src
Ian Hobson 30277233ce
Add support for the safe area on iOS (#7578)
This PR is a continuation of #4915 by @frederik-uni and @lucasmerlin
that introduces support for keeping egui content within the 'safe area'
on iOS (avoiding the notch / dynamic island / menu bar etc.), with the
following changes:

- `SafeArea` now wraps `MarginF32` and has been renamed to
`SafeAreaInsets` to clarify its purpose.
- `InputState::screen_rect` is now marked as deprecated in favour of
either `viewport_rect` (which contains the entire screen), or
`content_rect` (which is the viewport rect with the safe area insets
removed).
- I added some comments to the safe area insets logic pointing out the
[safe area API coming in winit
v0.31](https://github.com/rust-windowing/winit/issues/3910).

---------

Co-authored-by: frederik-uni <147479464+frederik-uni@users.noreply.github.com>
Co-authored-by: Lucas Meurer <hi@lucasmerlin.me>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2025-10-07 12:30:09 +02:00
..
align.rs Add `emath::fast_midpoint` (#7435) 2025-08-08 12:04:51 +02:00
easing.rs Use Rust edition 2024 (#7280) 2025-06-30 14:01:57 +02:00
gui_rounding.rs Make all lines and rectangles crisp (#5518) 2024-12-26 21:02:27 +01:00
history.rs Remove `extra_asserts` and `extra_debug_asserts` feature flags (#4478) 2024-05-10 19:39:08 +02:00
lib.rs Add `emath::fast_midpoint` (#7435) 2025-08-08 12:04:51 +02:00
numeric.rs Enable more clippy lints (#6853) 2025-04-24 17:32:50 +02:00
ordered_float.rs Improve `OrderedFloat` hash performance (#7512) 2025-09-08 17:39:52 +02:00
pos2.rs Use Rust edition 2024 (#7280) 2025-06-30 14:01:57 +02:00
range.rs Cross-widget text select (#3870) 2024-01-24 15:45:22 +01:00
rect.rs Add `emath::fast_midpoint` (#7435) 2025-08-08 12:04:51 +02:00
rect_align.rs Add support for the safe area on iOS (#7578) 2025-10-07 12:30:09 +02:00
rect_transform.rs Use Rust edition 2024 (#7280) 2025-06-30 14:01:57 +02:00
rot2.rs Add assert messages and print bad argument values in asserts (#5216) 2025-03-25 09:20:29 +01:00
smart_aim.rs Update MSRV from 1.86 to 1.88 (#7579) 2025-10-02 19:12:29 +02:00
ts_transform.rs Enable and fix some more clippy lints (#7426) 2025-08-08 09:57:53 +02:00
vec2.rs Use Rust edition 2024 (#7280) 2025-06-30 14:01:57 +02:00
vec2b.rs Update ScrollArea drag velocity when drag stopped (#5175) 2024-10-02 18:12:36 +02:00