egui/crates
Emil Ernerfeldt 6607cd95f9
⚠️ `Frame` now includes stroke width as part of padding (#5575)
* Part of https://github.com/emilk/egui/issues/4019

`Frame` now includes the width of the stroke as part of its size. From
the new docs:

### `Frame` docs
The total (outer) size of a frame is `content_size + inner_margin +
2*stroke.width + outer_margin`.

Everything within the stroke is filled with the fill color (if any).

```text
+-----------------^-------------------------------------- -+
|                 | outer_margin                           |
|    +------------v----^------------------------------+    |
|    |                 | stroke width                 |    |
|    |    +------------v---^---------------------+    |    |
|    |    |                | inner_margin        |    |    |
|    |    |    +-----------v----------------+    |    |    |
|    |    |    |             ^              |    |    |    |
|    |    |    |             |              |    |    |    |
|    |    |    |<------ content_size ------>|    |    |    |
|    |    |    |             |              |    |    |    |
|    |    |    |             v              |    |    |    |
|    |    |    +------- content_rect -------+    |    |    |
|    |    |                                      |    |    |
|    |    +-------------fill_rect ---------------+    |    |
|    |                                                |    |
|    +----------------- widget_rect ------------------+    |
|                                                          |
+---------------------- outer_rect ------------------------+
```

The four rectangles, from inside to outside, are:
* `content_rect`: the rectangle that is made available to the inner
[`Ui`] or widget.
* `fill_rect`: the rectangle that is filled with the fill color (inside
the stroke, if any).
* `widget_rect`: is the interactive part of the widget (what sense
clicks etc).
* `outer_rect`: what is allocated in the outer [`Ui`], and is what is
returned by [`Response::rect`].

### Notes
This required rewriting a lot of the layout code for `egui::Window`,
which was a massive pain. But now the window margin and stroke width is
properly accounted for everywhere.
2025-01-04 10:29:22 +01:00
..
ecolor Release 0.30 - egui_kittest and modals (#5487) 2024-12-16 17:45:35 +01:00
eframe Add `Harness::new_eframe` and `TestRenderer` trait (#5539) 2025-01-02 17:48:39 +01:00
egui ⚠️ `Frame` now includes stroke width as part of padding (#5575) 2025-01-04 10:29:22 +01:00
egui-wgpu Add `Harness::new_eframe` and `TestRenderer` trait (#5539) 2025-01-02 17:48:39 +01:00
egui-winit Re-enable IME support on Linux (#5198) 2024-12-31 13:37:05 +01:00
egui_demo_app ⚠️ `Frame` now includes stroke width as part of padding (#5575) 2025-01-04 10:29:22 +01:00
egui_demo_lib ⚠️ `Frame` now includes stroke width as part of padding (#5575) 2025-01-04 10:29:22 +01:00
egui_extras Store `Margin` using `i8` to reduce its size (#5567) 2025-01-02 16:05:52 +01:00
egui_glow Revert "Revert "forward x11 and wayland features to glutin" (#5391)" (#5490) 2024-12-17 09:36:03 +01:00
egui_kittest ⚠️ `Frame` now includes stroke width as part of padding (#5575) 2025-01-04 10:29:22 +01:00
egui_plot Move `egui_plot` to its own repo (#4828) 2024-07-15 18:45:19 +02:00
egui_web Fix typos (#2866) 2023-04-18 15:52:45 +02:00
emath Make all lines and rectangles crisp (#5518) 2024-12-26 21:02:27 +01:00
epaint Better rounding of rectangles with thin outlines (#5571) 2025-01-02 23:50:40 +01:00
epaint_default_fonts Release 0.30 - egui_kittest and modals (#5487) 2024-12-16 17:45:35 +01:00