egui/crates/epaint/src
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
..
text Update MSRV to Rust 1.72 (#3595) 2023-11-21 17:26:35 +01:00
util Fix clippy issues from 1.74 (#3558) 2023-11-16 15:50:44 +01:00
bezier.rs Improve clippy, and add more docs (#3306) 2023-09-05 14:11:22 +02:00
image.rs Multiple viewports/windows (#3172) 2023-11-16 11:25:05 +01:00
lib.rs Keep unsafe code forbidden when puffin is disabled (#3603) 2023-11-22 20:37:46 +01:00
mesh.rs Support images with rounded corners (#3257) 2023-08-15 09:29:30 +02:00
mutex.rs Use `impl Into<Stroke>` as argument in a few more places (#3420) 2023-11-10 21:36:51 +01:00
shadow.rs Style tweaks (#2406) 2022-12-08 10:55:13 +01:00
shape.rs PaintCallbackInfo::viewport_in_pixels now guarantees to stay in bounds (#3604) 2023-11-22 21:01:38 +01:00
shape_transform.rs Fix typos (#2866) 2023-04-18 15:52:45 +02:00
stats.rs Increase MSRV to 1.67 (#3234) 2023-08-11 13:54:02 +02:00
stroke.rs Update MSRV to Rust 1.70.0 (#3310) 2023-09-06 07:59:24 +02:00
tessellator.rs Update MSRV to Rust 1.72 (#3595) 2023-11-21 17:26:35 +01:00
texture_atlas.rs Replace `tracing` with `log` (#2928) 2023-04-18 21:11:26 +02:00
texture_handle.rs Improved texture loading (#3315) 2023-09-12 10:39:17 +02:00
textures.rs Some clippy fixes from 1.72.0 2023-08-25 07:44:25 +02:00