Improve multi-viewports across monitors with different scales (#3663)

It required some ugly code in `egui-winit` in order to fix this without
breaking sem-ver (I want this to land in a 0.24.1 patch release). I'll
clean up in time for 0.25.

There is still a font rendering bug when using immediate viewports
across multiple viewports, but that's harder to fix.
This commit is contained in:
Emil Ernerfeldt
2023-11-30 12:08:53 +01:00
committed by GitHub
parent 37244e3632
commit 61a7b90d5b
8 changed files with 213 additions and 116 deletions
+3 -1
View File
@@ -262,6 +262,7 @@ pub struct ViewportBuilder {
/// This is wayland only. See [`Self::with_app_id`].
pub app_id: Option<String>,
/// The desired outer position of the window.
pub position: Option<Pos2>,
pub inner_size: Option<Vec2>,
pub min_inner_size: Option<Vec2>,
@@ -506,7 +507,8 @@ impl ViewportBuilder {
self
}
/// This will probably not work as expected!
/// The initial "outer" position of the window,
/// i.e. where the top-left corner of the frame/chrome should be.
#[inline]
pub fn with_position(mut self, pos: impl Into<Pos2>) -> Self {
self.position = Some(pos.into());