Commit Graph

3849 Commits

Author SHA1 Message Date
Emil Ernerfeldt 87de733da3
Better define the meaning of `SizeHint` (#7079) 2025-05-23 13:52:36 +02:00
Emil Ernerfeldt ec8b41f7ec
Make `Image::paint_at` pixel-perfect crisp for SVG images (#7078) 2025-05-23 10:15:17 +02:00
Emil Ernerfeldt b8334f365b
Fix sometimes blurry SVGs (#7071)
* Closes https://github.com/emilk/egui/issues/3501

The problem occurs when you want to render the same SVG at different
scales, either at the same time in different parts of your UI, or at two
different times (e.g. the DPI changes).

The solution is to use the `SizeHint` as part of the key.

However, when you have an SVG in a resizable container, that can lead to
hundreds of versions of the same SVG. So new eviction code is added to
handle this case.
2025-05-21 20:01:40 +02:00
Emil Ernerfeldt b05a40745f
Bug fix: make sure `end_pass` is called for all loaders (#7072)
None of the built-in loaders does any cache eviction (yet), but 3rd
party ones might have
2025-05-21 19:52:59 +02:00
Emil Ernerfeldt f57cb27386
Include test windows in `egui_demo_lib` snapshot tests (#7070) 2025-05-21 17:44:27 +02:00
Emil Ernerfeldt 54ae2360ec
Fix incorrect color fringe colors on SVG:s (#7069)
This is a problem that affected the fringes on all SVG:s with
transparency, especially on a light background.

## Before

![image](https://github.com/user-attachments/assets/342823ad-005c-4f82-83a6-d2dcccfd3221)


## After

![image](https://github.com/user-attachments/assets/73398265-d333-461b-8c2b-fce405d95a9c)
2025-05-21 17:18:36 +02:00
Emil Ernerfeldt f23618701f
Update `emoji-icon-font` with fix for fullwidth latin characters (#7067)
* This PR is based on https://github.com/emilk/egui/pull/5877 by
@danielhjacobs

## Original PR description
Replace the current `emoji-icon-font.ttf` with the updated font from
https://github.com/jslegers/emoji-icon-font/pull/19 to address
https://github.com/emilk/egui/issues/1284. The second commit then
removes the now unnecessary hack.

* Closes https://github.com/emilk/egui/issues/1284
* Closes https://github.com/emilk/egui/pull/5877

---------

Co-authored-by: Daniel Jacobs <danielhunterjacobs@gmail.com>
2025-05-21 13:22:23 +02:00
valadaptive 6ccb768000
Bump accesskit to 0.19 (#7040)
Parley's bumped accesskit to 0.19, so we have to as well. It's a bit
concerning that we may end up locked to the version of accesskit that
Parley uses, but oh well.

[This kittest PR will have to be merged
first.](https://github.com/rerun-io/kittest/pull/11)

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2025-05-19 10:22:10 +02:00
Patrick Marks a15040c011
Fix `visual_bounding_rect` for rotated text (#7050)
TextShape.visual_bounding_rect was not taking the text rotation into
account. I manually tested drawing the new bounding box on top of the
text for various rotations & anchor settings. For example:
<img width="191" alt="image"
src="https://github.com/user-attachments/assets/56528fc7-7e7d-45af-b92a-c1cd307ff205"
/>

The unit test I added will fail without this patch, but perhaps doesn't
add much value.

* [x] I have followed the instructions in the PR template
2025-05-18 19:19:12 +02:00
Piotr Podusowski 12cd35f48c
Disallow `accesskit` on Android NativeActivity, making `hello_android` working again (#6855)
Follow up for https://github.com/emilk/egui/pull/6766

I wasn't sure if `compile_error` is appropriate. It felt right.
2025-05-18 13:17:28 +02:00
Abdellatif EL MIZEB cb4acbc262
Fix typo in deprecation message for `ComboBox::from_id_source` (#7055)
This PR corrects the deprecation note on ComboBox::from_id_source:

Changed:
`#[deprecated = "Renamed id_salt"]`

To:
`#[deprecated = "Renamed from_id_salt"]`
2025-05-18 13:02:58 +02:00
Emil Ernerfeldt 81b7e7f05a
Make the default spinner more high-res (#7044)
Make it nice and smooth when big
2025-05-11 22:15:07 +02:00
TÖRÖK Attila 773232b139
Update to wgpu 25 (#6744)
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2025-05-10 13:16:49 +02:00
Hubert Głuchowski e9609ac94e
Fix `leading_space` sometimes being ignored during paragraph splitting (#7031)
Fixes a regression introduced in https://github.com/emilk/egui/pull/5411
(possibly
d74bee536f)
that breaks `leading_space` handling.
I think this is what the condition should be but I haven't touched this
code in a while.
2025-05-08 15:47:13 +02:00
Lucas Meurer 7872b5b363
Fix some links that were accidentally broken (#7036)
#7034 renamed a couple too many links
2025-05-08 13:17:40 +02:00
Lucas Meurer 120d736cfc
Add `ImageLoader::has_pending` and `wait_for_pending_images` (#7030)
With kittest it was difficult to wait for images to be loaded before
taking a snapshot test.
This PR adds `Harness::with_wait_for_pending_images` (true by default)
which will cause `Harness::run` to sleep until all images are loaded (or
`HarnessBuilder::with_max_steps` is exceeded).

It also adds a new ImageLoader::has_pending and
BytesLoader::has_pending, which should be implemented if things are
loaded / decoded asynchronously.

It reverts https://github.com/emilk/egui/pull/6901 which was my previous
attempt to fix this (but this didn't work since only the tested crate is
compiled with cfg(test) and not it's dependencies)
2025-05-08 09:27:52 +02:00
Emil Ernerfeldt 0fd6a805a4
Add `lycheee.toml` to ignore 429 (#7035)
Trying to get CI green
2025-05-08 09:26:36 +02:00
Emil Ernerfeldt d0876a1a60
Rename `master` branch to `main` (#7034)
For consistency with other repositories, i.e. so I can write `git
checkout main` without worrying which repo I'm browsing.
2025-05-08 09:15:42 +02:00
Emil Ernerfeldt 7216d0e386
Use mimalloc for benchmarks (#7029)
`mimalloc` is a _much_ faster allocator, especially important when doing
a lot of small allocations (which egui does).

We use `mimalloc` in Rerun, and I recommend everyone to use it.

## The difference it makes

![image](https://github.com/user-attachments/assets/b22e0025-bc5e-4b3c-94e0-74ce46e86f85)
2025-05-06 17:54:06 +02:00
Lucas Meurer 5bb20f511e
Fix links and text selection in horizontal_wrapped layout (#6905)
* Closes <https://github.com/emilk/egui/issues/6904>
* [x] I have followed the instructions in the PR template

This was broken in https://github.com/emilk/egui/pull/5411. Not sure if
this is the best fix or if `PlacedRow::rect` should be updated, but I
think it makes sense that PlacedRow::rect ignores leading space.
2025-05-06 17:40:18 +02:00
Lucas Meurer 71e0b0859c
Make `WidgetText` smaller and faster (#6903)
* In preparation of #5830, this should reduce the performance impact of
that PR

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2025-05-06 17:35:56 +02:00
Emil Ernerfeldt ba70106399 Fix enforce_branch_name.yml 2025-05-06 10:25:02 +02:00
Alexander Nadeau 6c922f72a8
Fix text distortion on mobile devices/browsers with `glow` backend (#6893)
<!--
Please read the "Making a PR" section of
[`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/master/CONTRIBUTING.md)
before opening a Pull Request!

* Keep your PR:s small and focused.
* The PR title is what ends up in the changelog, so make it descriptive!
* If applicable, add a screenshot or gif.
* If it is a non-trivial addition, consider adding a demo for it to
`egui_demo_lib`, or a new example.
* Do NOT open PR:s from your `master` branch, as that makes it hard for
maintainers to test and add commits to your PR.
* Remember to run `cargo fmt` and `cargo clippy`.
* Open the PR as a draft until you have self-reviewed it and run
`./scripts/check.sh`.
* When you have addressed a PR comment, mark it as resolved.

Please be patient! I will review your PR, but my time is limited!
-->

Did not test on platforms other than my phone, but I can't imagine it
causing problems. AFAIK if highp isn't supported then `precision highp
float;` needs to still not cause the program to fail to link/compile or
anything; it should just silently use some other precision.

* Fixes https://github.com/emilk/egui/issues/4268 for me but I only
tested it on a native Android app and I don't know whether backends
other than glow are affected.
* [x] I have followed the instructions in the PR template (but the
change is trivial so I'm just doing it from the master branch)

Before:

![image](https://github.com/user-attachments/assets/9f449749-5a48-4e9c-aef0-7a8ac3912eb6)

After:

![image](https://github.com/user-attachments/assets/544e5977-13e0-411a-bccf-b15a15289e28)
2025-04-30 14:12:08 +02:00
Emil Ernerfeldt f3611e3e5a
Enforce that PRs are not opened from the 'master' branch of a fork (#6899)
## What
Fail all PRs that are opened from the master/main branch of the fork.

## Why
PR:s opened from the `master` branch cannot be collaborated on. That is,
we maintainers cannot push our own commits to it (e.g. to fix smaller
problems with it before merging).

## How
Untested code straight from Claude 3.7 😅
2025-04-30 14:10:59 +02:00
Lucas Meurer 2947821c60
Load images on the ui thread for tests (#6901)
https://github.com/emilk/egui/pull/5394 made it so images would load on
a background thread, which is great. But this makes snapshot tests that
have images via include_image!() flakey since they might or might not
load by the time the snapshot is rendered.
This is no perfect solution, since the underlying problem of "waiting
for something async to happen" still exists and we should add some more
general solution for that.
2025-04-30 12:55:57 +02:00
Lucas Meurer fdaac16e4a
Fix image button panicking with tiny `available_space` (#6900)
* Fixes <https://github.com/emilk/egui/issues/6772>
* [x] I have followed the instructions in the PR template
2025-04-30 10:40:50 +02:00
Lucas Meurer 1ab3259008
Add italic button benchmark to test `RichText` performance impact (#6897)
Time on my m4 pro macbook: 302.79 ns (vs 303.83 ns for the regular
button 🤷)
2025-04-30 10:38:41 +02:00
Will Brown c075053391
Add external eventloop support (#6750)
<!--
Please read the "Making a PR" section of
[`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/master/CONTRIBUTING.md)
before opening a Pull Request!

* Keep your PR:s small and focused.
* The PR title is what ends up in the changelog, so make it descriptive!
* If applicable, add a screenshot or gif.
* If it is a non-trivial addition, consider adding a demo for it to
`egui_demo_lib`, or a new example.
* Do NOT open PR:s from your `master` branch, as that makes it hard for
maintainers to test and add commits to your PR.
* Remember to run `cargo fmt` and `cargo clippy`.
* Open the PR as a draft until you have self-reviewed it and run
`./scripts/check.sh`.
* When you have addressed a PR comment, mark it as resolved.

Please be patient! I will review your PR, but my time is limited!
-->

* Closes #2875
* Closes https://github.com/emilk/egui/pull/3340
* [x] I have followed the instructions in the PR template

Adds `create_native`. Similiar to `run_native` but it returns an
`EframeWinitApplication` which is a `winit::ApplicationHandler`. This
can be run on your own event loop. A helper fn `pump_eframe_app` is
provided to pump the event loop and get the control flow state back.

I have been using this approach for a few months.

---------

Co-authored-by: Will Brown <opensource@rebeagle.com>
2025-04-29 12:09:23 +02:00
mitchmindtree fed2ab5df3
feat: Add `Scene::sense` option for customising how `Scene` should respond to user input (#5893)
Allows for specifying how the `Scene` should respond to user input.

With #5892, closes #5891.

---

Edit: Failing tests unrelated and appear on master:
https://github.com/emilk/egui/actions/runs/14330259861/job/40164414607.

---------

Co-authored-by: Lucas Meurer <lucasmeurer96@gmail.com>
2025-04-29 12:07:39 +02:00
TÖRÖK Attila 8d9e42413a
Remove outdated skip entries from deny.toml (#6862)
Looks like these got deduplicated sometime.
2025-04-29 12:03:59 +02:00
TÖRÖK Attila d666742c13
Bump `ron` to `0.10.1` (#6861)
This should help `cargo-deny` be at peace with
https://github.com/emilk/egui/pull/6860, pending
https://github.com/gfx-rs/wgpu/pull/7557.
2025-04-29 12:03:24 +02:00
Gaelan McMillan 3a02963c33
Add macOS-specific `has_shadow` and `with_has_shadow` to ViewportBuilder (#6850)
* [X] I have followed the instructions in the PR template

This PR fixes a ghosting issue I encountered while making a native macOS
transparent overlay app using egui and eframe by exposing the [existing
macOS window attribute
`has_shadow`](https://docs.rs/winit/latest/winit/platform/macos/trait.WindowExtMacOS.html#tymethod.has_shadow)
to the `ViewportBuilder` via a new `with_has_shadow` option.

## Example of Ghosting Issue

### Before `ViewportBuilder::with_has_shadow`
By default, the underlying `winit` window's `.has_shadow()` defaults to
`true`.


https://github.com/user-attachments/assets/c3dcc2bd-535a-4960-918e-3ae5df503b12

### After `ViewportBuilder::with_has_shadow`


https://github.com/user-attachments/assets/484462a1-ea88-43e6-85b4-0bb9724e5f14

Source code for the above example can be found here:

https://github.com/gaelanmcmillan/egui-overlay-app-with-shadow-artifacts-example/blob/main/src/main.rs


### Further background
By default on macOS, `winit` windows have a drop-shadow effect. When
creating a fully transparent overlay GUI, this drop-shadow can create a
ghosting effect, as the window content has a drop shadow which is not
cleared by the app itself. This issue has been experienced by users of
`bevy`, another Rust project that has an upstream dependency on `winit`:
https://github.com/bevyengine/bevy/issues/18673
2025-04-29 12:02:42 +02:00
Lucas Meurer 7d185acb41
Add button benchmark (#6854)
This helped me benchmark the atomic layout (#5830) changes.

I also realized that the label benchmark wasn't testing the painting,
since the buttons at some point will be placed outside the screen_rect,
meaning it won't be painted.

This fixes it by benching the label in a child ui.

The `label &str` benchmark went from 483 ns to 535 ns with these
changes.

EDIT:

I fixed another benchmark problem, since the benchmark would show the
same widget millions of times for a single frame, the WidgetRects
hashmap would get huge, causing each iteration to slow down a bit more
and causing the benchmark to have unreliable results.

With this the `label &str` benchmark went from 535ns to 298ns. Also the
`label format!` benchmark now takes almost the same time (302 ns).
Before, it was a lot slower since it reused the same Context which
already had millions of widget ids.
2025-04-28 11:58:05 +02:00
MStarha f2ce6424f3
`ScrollArea` improvements for user configurability (#5443)
* Closes <https://github.com/emilk/egui/issues/5406>
* [x] I have followed the instructions in the PR template

The changes follow what is described in the issue with a couple changes:
- Scroll bars are not hidden when dragging is disabled, for that
`ScrollArea::scroll_bar_visibility()` has to be used, this is as not to
limit the user configurability by imposing a specific function. The user
might want to retain the scrollbars visibility to show the current
position.
- The input for mouse wheel scrolling is unchanged. When I inspected the
code initially I made a mistake in recognizing the source of scrolling.
Current implementation is in fact using
`InputState::smooth_scroll_delta` and not `PassState::scroll_delta`,
therefore it is possible to prevent scrolling by setting the
`InputState::smooth_scroll_delta` to zero before painting the
`ScrollArea`.

A simple demo is available at
https://github.com/MStarha/egui_scroll_area_test
2025-04-25 11:01:22 +02:00
Emil Ernerfeldt f9245954eb
Enable more clippy lints (#6853)
* Follows https://github.com/emilk/egui/pull/6848
2025-04-24 17:32:50 +02:00
TÖRÖK Attila fdb9aa282a
Raise MSRV to 1.84 (#6848)
Prerequisite of https://github.com/emilk/egui/pull/6744.
See: https://github.com/gfx-rs/wgpu/pull/7218,
https://github.com/gfx-rs/wgpu/pull/7425

Please be aware that Rust 1.84 enables some (more) WASM extensions by
default, and ships with an `std` built with them enabled:
https://blog.rust-lang.org/2024/09/24/webassembly-targets-change-in-default-target-features/
According to `rustc +1.84 --print=cfg --target wasm32-unknown-unknown`,
these are: `multivalue`, `mutable-globals`, `reference-types`, and
`sign-ext`.
(c.f. `rustc +1.84 --print=cfg --target wasm32-unknown-unknown -C
target-cpu=mvp` enabling none.)
For reference: https://webassembly.org/features/

----

If support is desired for ancient/esoteric browsers that don't have
these implemented, there are two ways to get around this:
- Target `wasm32v1-none` instead, but that's a `no-std` target, and I
suppose a lot of dependencies don't work that way (e.g.
https://github.com/gfx-rs/wgpu/issues/6826)
- Using the `-Ctarget-cpu=mvp` and `-Zbuild-std=panic_abort,std` flags,
and the `RUSTC_BOOTSTRAP=1` escape hatch to allow using the latter with
non-`nightly` toolchains - until
https://github.com/rust-lang/wg-cargo-std-aware is stabilized. (For
reference:
https://github.com/ruffle-rs/ruffle/pull/18528/files#diff-fb2896d189d77b35ace9a079c1ba9b55777d16e0f11ce79f776475a451b1825a)

I don't think either of these is particularly advantageous, so I suggest
just accepting that browsers will have to have some extensions
implemented to run `egui`.
2025-04-24 17:00:29 +02:00
TÖRÖK Attila 3dd8d34257
CI: Install wasm-opt 123 from the GitHub release of Binaryen (#6849)
* Prerequisite of https://github.com/emilk/egui/pull/6848
2025-04-24 15:39:01 +02:00
Bennet Bleßmann 6f910f60e9
Protect against NaN in hit-test code (#6851)
* Closes <https://github.com/emilk/egui/issues/6756>
* [x] I have followed the instructions in the PR template
2025-04-24 14:50:34 +02:00
MStarha 69b9f0eede
Rework `TextEdit` arrow navigation to handle Unicode graphemes (#5812)
* [x] I have followed the instructions in the PR template

Previously, navigating text in `TextEdit` with Ctrl + left/right arrow
would jump inside words that contained combining characters (i.e.
diacritics). This PR introduces new dependency of `unicode-segmentation`
to handle grapheme encoding. The new implementation ignores whitespace
and other separators such as `-` (dash) between words, but respects `_`
(underscore).

---------

Co-authored-by: lucasmerlin <hi@lucasmerlin.me>
2025-04-22 17:44:10 +02:00
rustbasic a0f072ab1e
Fix bug in pointer movement detection (#5329)
Fix: Popups do not appear in certain situations.

* Closes #5080
* Related #5107

The root cause is that `last_move_time` is not updated in certain
situations (slow situations?).
2025-04-22 12:00:22 +02:00
Sven Niederberger 61e883be25
Revert "Add `OutputCommand::SetPointerPosition` to set mouse position" (#5867)
Reverts emilk/egui#5776

I noticed that this is already a `ViewportCommand`. Sorry for not seeing
that earlier.
2025-04-22 11:52:20 +02:00
mitchmindtree cd318f0e55
feat: Add `Scene::drag_pan_buttons` option. Allows specifying which pointer buttons pan the scene by dragging. (#5892)
This adds an option for specifying the set of pointer buttons that can
be used to pan the scene via clicking and dragging.

The original behaviour where all buttons can pan the scene by default is
maintained.

Addresses part of #5891.

---

Edit: It looks like the failing test is unrelated and also appears on
master:
https://github.com/emilk/egui/actions/runs/14330259861/job/40164414607.

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2025-04-22 11:42:24 +02:00
mkalte 114460c1de
Change popup memory to be per-viewport (#6753)
Starting with 77244cd4c5 the popup
open-state is cleaned up per memory pass.

This becomes problematic for implementations that share memory between
viewports (i.e. all of them, as far as i understand it), because each
viewport gets a context pass, and thus a memory pass, which cleans out
popup open state.

To illustrate my issue, i have modifed the multiple viewport example to
include a popup menu for the labels:
https://gist.github.com/mkalte666/4ecd6b658003df4c6d532ae2060c7595
(changes not included in this pr).

Then, when i try to use the popups, i get this: 


https://github.com/user-attachments/assets/7d04b872-5396-4823-bf30-824122925528

Immediate viewports just break popup handling in general, while deferred
viewports kinda work, or dont. In this example ill be honest, it kind of
still did, sometimes. In my more complex app with multiple viewports
(where i encountered this first) it also just broke - even when just
showing root and one nother. Probably to do with the order wgpu vs glow
draws the viewports? Im not sure. In any case:

This commit adds `Memory::popup` (now `Memory::popups`) to the
per-viewport state of memory, including viewport aware cleanup, and
adding it to the list of things cleaned if a viewport goes away.

This results in the expected behavior:



https://github.com/user-attachments/assets/fd1f74b7-d3b2-4edc-8dc4-2ad3cfa2160e

I will note that with this, changing focus does not cause a popup to be
closed, which is consistent with current behavior on a single app.

Hope this helps 

~Malte 

<!--
Please read the "Making a PR" section of
[`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/master/CONTRIBUTING.md)
before opening a Pull Request!

* Keep your PR:s small and focused.
* The PR title is what ends up in the changelog, so make it descriptive!
* If applicable, add a screenshot or gif.
* If it is a non-trivial addition, consider adding a demo for it to
`egui_demo_lib`, or a new example.
* Do NOT open PR:s from your `master` branch, as that makes it hard for
maintainers to test and add commits to your PR.
* Remember to run `cargo fmt` and `cargo clippy`.
* Open the PR as a draft until you have self-reviewed it and run
`./scripts/check.sh`.
* When you have addressed a PR comment, mark it as resolved.

Please be patient! I will review your PR, but my time is limited!
-->

* Closes <https://github.com/emilk/egui/issues/THE_RELEVANT_ISSUE>
* [x] I have followed the instructions in the PR template
* [x] ~~I have run check.sh locally~~ CI on the fork, including checks,
went through.
2025-04-22 11:38:17 +02:00
Marek Bernat 009bfe5ada
Add a `Slider::update_while_editing(bool)` API (#5978)
* Closes #5976
* [x] I have followed the instructions in the PR template
- The `scripts/check.sh` fails in `cargo-deny` because of a security
vulnerability in `crossbeam-channel` but this is also present on
`master`.


https://github.com/user-attachments/assets/a964c968-bb76-4e56-88e1-d1e3d51a401a
2025-04-22 11:28:34 +02:00
Lucas Meurer 501905b60d
Add tests for layout and visuals of most egui widgets (#6752)
This is mostly in preparation for #5830 where I want to ensure that I
don't introduce any regressions
2025-04-16 18:58:58 +02:00
Christopher Cerne 0f1d6c2818
Support SVG Text Rendering in egui_extras (#5979)
**Added**
* Create `svg_text` feature flag to support text rendering & loading of
system fonts.

**Changed**
* Updates `resvg` to `0.45`.
* Adds `usvg::Options` field to the `SvgLoader` structure.
* Change function signatures to support passing `usvg::Options` to
downstream `load_svg_bytes_with_size`.

**Additional Info**
* I used this PR as a reference:
https://github.com/emilk/egui/pull/4659. @xNWP can you see if this
adequately resolves your concern from your original PR?
* Closes https://github.com/emilk/egui/issues/5977 (we may want to open
another issue for my other thoughts in this issue)
* Also, I would like to thank @xNWP and their original PR for being a
good reference for this one.
* [x] I have followed the instructions in the PR template
2025-04-14 11:13:17 +02:00
Emil Ernerfeldt a8e0c56a8f Update crossbeam-channel to resolve RUSTSEC 2025-04-13 19:12:22 +02:00
Lucas Meurer 7055141c18
Update failing snapshot tests (#5894)
For some reason the pipeline in https://github.com/emilk/egui/pull/5698
succeeded even though the snapshots should have been updated. This
updates the snapshots.
2025-04-09 12:11:46 +02:00
giuseppeferrari c6bd30642a
Avoid infinite extension of ColorTest inside a Window (#5698)
Current implementation of ColorTest infinitely expand horizontally at
each redraw if included in a Window.

The effect can be see replacing the Panel in the ColorTestApp::update
with a Window:
```
egui::CentralPanel::default().show(ctx, |ui| {
   egui::Window::new("Colors").vscroll(true).show(ctx, |ui| {
   if frame.is_web() {
      ui.label(
         "NOTE: Some old browsers stuck on WebGL1 without sRGB support will not pass the color test.",
      );
      ui.separator();
   }
   egui::ScrollArea::both().auto_shrink(false).show(ui, |ui| {
      self.color_test.ui(ui);
   });
   self.color_test.ui(ui);
});
```

The cause is the is the _pixel_test_strokes_ function that, at each
redraw, tries to expand the target rectangle of 2.0 points in each
direction.
2025-04-08 11:38:13 +02:00
Aarni Koskela 36e007bd8c
Add overline option for Table rows (#5637)
* Closes no issue, I just needed this for an app and figured it could be
useful.
* [x] I have followed the instructions in the PR template

This PR adds an `overline` option for `egui_extras::TableRow`, which is
useful for visually grouping rows. The overline consumes no layout
space.

A screenshot of the demo app, showing every 7th row getting an overline.

<img width="704" alt="Screenshot 2025-01-25 at 14 40 08"
src="https://github.com/user-attachments/assets/9ccbee3d-296d-4afd-9290-c669e4ede1c0"
/>

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2025-04-08 11:36:43 +02:00