egui/crates
Andreas Reich f9f5db9885
PaintCallbackInfo::viewport_in_pixels now guarantees to stay in bounds (#3604)
* Fixes https://github.com/rerun-io/rerun/issues/4297
* tested against a very hasty and incomplete port of egui/trunk, found
[here](https://github.com/rerun-io/rerun/tree/andreas/experimental-egui-trunk)


In rare cases in can happen that the viewport returned by
`PaintCallbackInfo` is outside the bounds of the screen.
for at least [wgpu/webgpu in
particular](https://www.w3.org/TR/webgpu/#dom-gpurenderpassencoder-setviewport)
this is invalid usage, other backends might be affected as well.
Since this happened due to a float rounding error (in one repro case I
had I got (width==1126.5625) + (offset=715.4376) = 1842.0001 for a
resolution of 1842) I decided to do away with fractional values on the
viewport alltogether. They _technically_ make sense since a viewport is
only specifying the NDC to pixel coordinate conversion, but practically
this may lead to surprising sub-sampling issues.

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-11-22 21:01:38 +01:00
..
ecolor Update MSRV to Rust 1.72 (#3595) 2023-11-21 17:26:35 +01:00
eframe Fix: fall back to default egui icon if non is set (#3610) 2023-11-22 20:54:16 +01:00
egui Keep unsafe code forbidden when puffin is disabled (#3603) 2023-11-22 20:37:46 +01:00
egui-wgpu PaintCallbackInfo::viewport_in_pixels now guarantees to stay in bounds (#3604) 2023-11-22 21:01:38 +01:00
egui-winit Introduce global `zoom_factor` (#3608) 2023-11-22 20:34:51 +01:00
egui_demo_app Introduce global `zoom_factor` (#3608) 2023-11-22 20:34:51 +01:00
egui_demo_lib Keep unsafe code forbidden when puffin is disabled (#3603) 2023-11-22 20:37:46 +01:00
egui_extras Keep unsafe code forbidden when puffin is disabled (#3603) 2023-11-22 20:37:46 +01:00
egui_glow PaintCallbackInfo::viewport_in_pixels now guarantees to stay in bounds (#3604) 2023-11-22 21:01:38 +01:00
egui_plot Update MSRV to Rust 1.72 (#3595) 2023-11-21 17:26:35 +01:00
egui_web Fix typos (#2866) 2023-04-18 15:52:45 +02:00
emath Keep unsafe code forbidden when puffin is disabled (#3603) 2023-11-22 20:37:46 +01:00
epaint PaintCallbackInfo::viewport_in_pixels now guarantees to stay in bounds (#3604) 2023-11-22 21:01:38 +01:00