Commit Graph

2909 Commits

Author SHA1 Message Date
Emil Ernerfeldt 0e7bf6dfcf Add screenshot to custom_plot_manipulation example 2024-01-08 11:16:44 +01:00
Mike Krüger 8b4c9fd374
Added key mappings for `[`, `]`, `,` and `\`. (#3373)
Added key mappings for '[', ']', ',' and '\'.

* Closes https://github.com/emilk/egui/issues/3372

## Added keys

* egui::Key::Backslash
* egui::Key::OpenBracket
* egui::Key::CloseBracket
* egui::Key::Comma

Co-authored-by: Mike Krüger <mkrueger@posteo.de>
2024-01-08 11:15:15 +01:00
Emil Ernerfeldt d79fae5de1 Add warning about consume_shortcut and friends 2024-01-08 09:49:59 +01:00
StarStarJ 7b105cfa0f
Invalidate font atlas on any change to `pixels_per_point`, not matter how small (#3698)
Apparently the font implementation uses a distance check to decide if
the font(or whatever) need recalculations, after dpi changed:

8d4de866d4/crates/epaint/src/text/fonts.rs (L381-L382)

This leads to warnings when the pixel_per_point diff is very low and
spams the log. (<- this happens for me if i resize my window on kwin,
e.g. maximize it)

(I don't want to debate if the float difference generally makes sense,
so if you want to rework that instead just close this pr)
2024-01-08 09:13:34 +01:00
One b0c7a7fca4
Add missing links to source code (#3770)
<!--
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.
* 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 add commits to your PR.
* Remember to run `cargo fmt` and `cargo cranky`.
* 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>.
2024-01-08 09:07:25 +01:00
untbu 937c09f14a
[ScrollArea]: Add option to always scroll the only enabled direction (#3710)
Add option to use the scroll input from both directions to scroll the
enabled direction if scrolling is enabled for only one direction. This
can be used to allow horizontal scrolling without pressing shift if
vertical scrolling is disabled.

Closes <https://github.com/emilk/egui/issues/3624>.
2024-01-07 22:20:31 +01:00
Emil Ernerfeldt 8c30e8c5f7
Highlight submenu buttons when hovered and open (#3780)
Submenu buttons in menues now properly highlight when hovered and when
opened.

…plus a bunch of other cleanup
2024-01-07 22:08:32 +01:00
LoganDark 327f599407
add methods to manipulate TextEditState undoer (#3479)
This feels awful, @emilk why does this have to be an Arc?

Should the Arc be replaced with a new one when set_undoer is called, or
should it just replace the undoer inside the Arc?

Closes #3436
2024-01-07 17:19:37 +01:00
Fleabit 5432f91a4d
Have non-resizable Areas ignore mouse input just beyond their bounds (#3039)
As described in #576, the method `Memory::layer_id_at` expands the
hit-testing region for every `Area` slightly. This is necessary so that,
when the user clicks to resize a `Window`, the mouse input isn't routed
to a different `Window`.

For non-resizable `Area`s (such as dropdown menus, context menus, date
pickers, and any non-resizable `Window`), this causes them to be
surrounded by a "dead zone" where any underlying widgets can't be
hovered or clicked. The effect is particularly noticeable in menu bars.

This commit adds a persisted `edges_padded_for_resize` property to
`Area`, which is `true` when the `Area` belongs to a resizable `Window`
and `false` for all other `Area`s. The hit-testing region is only
expanded when this property is `true`.

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-01-07 17:04:29 +01:00
Guillaume Schmid 1777bb7789
Implemented window header color change when focused (on top). (#3515)
This PR replaces an old one with many problems (no collapse icon, the
header background was not funny colored, ugly...). It fixes those
problems.

It implements the highlight of the header to the focused window. And
allows the rest of the application to know the selected window. It
allows, for instance, to display multiple windows with images and some
additional meta information about those images on the side panel of the
main window. The side panel updates itself according to the selected
image window.

* Added a theme color for the selected window header.
* Added a function to retrieve the LayerId of the focused window.
* Implemented a simple demo of this function in the demo app where a
message states if the Option window is focused (at the bottom of the
Options window).

![Capture d’écran du 2023-10-30
10-30-39](https://github.com/emilk/egui/assets/18464073/fcea4dbf-2b07-485c-8c41-274ad5c738e4)

A technical point: 
The header color is applied with a transparency of 125 so the
collapsible button becomes visible.
The reason is that the collapsible button is rendered before the rest of
the header and before the header size is known.
We cannot draw the background before knowing this value, so rendering
with transparency is a solution to see the collapsible button through
the header background.

This PR has been sponsored by my company, which left me to do it during
my work time.
This is part of an evil plan to convince them to switch to rust for new
projects :)

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-01-07 16:57:32 +01:00
YgorSouza 4a6999bbad
Add option to customize progress bar rounding (#2881)
The minimum filled width is adapted to the radius and the animation is
disabled so it renders correctly.

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-01-07 16:43:13 +01:00
Mike Tsao 3b19303e02
Fix typo in `crates/egui_glow/README.md` (#2956)
<!--
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.
* 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 thart makes it
difficult for maintainers to 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 you PR, but my time is limited!
-->

Closes <https://github.com/emilk/egui/issues/THE_RELEVANT_ISSUE>.
2024-01-07 16:31:34 +01:00
Danny Stoll 128afdde0a
Changed logic for submenus closing (#3055)
This tiny change removes the trigger for a submenu to close if the mouse
is no longer hovering over it or one of its children. Now, the menu
stays open until a different menu item is selected. This aims to address
<https://github.com/emilk/egui/issues/2853>.

I suspected that a new trigger would need to be implemented so that
multiple menu items don't remain open simultaneously, but after some
testing, this does not appear to occur.

This change leaves `MenuState::hovering_current_submenu` and
`MenuState::close_submenu` as dead code in case they might be useful
later.

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-01-07 16:25:29 +01:00
Ivan bfed2b4195
Add `DragValue`s for RGB(A) in the color picker (#2734)
Added some DragValue widgets in the color_picker widget as input fields
for managing the RGBA values.
In case the provided values result in a not valid premultiplied alpha
RGBA color, a button will appear next to the input fields, to be used to
multiply the values with the alpha channel.


![image](https://user-images.githubusercontent.com/68190772/218438019-8b46936f-d025-4287-ac27-2b937f8f3d7c.png)

Closes <https://github.com/emilk/egui/issues/2716>.

---------

Co-authored-by: IVANMK-7 <68190772+IVANMK-7@users.noreply.github.com>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Co-authored-by: Brian Janssen <tosti007@users.noreply.github.com>
2024-01-07 16:12:59 +01:00
Emil Ernerfeldt 51e5d28b39
Rename `from_hex_string` -> `from_hex`, and `to_hex_string` -> `to_hex` (#3777)
Follow-up to https://github.com/emilk/egui/pull/3570
2024-01-07 10:08:57 +01:00
YgorSouza 669473ccd2
Add `Color32::from_hex_string` and `Color32::to_hex_string` (#3570)
<!--
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.
* 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 add commits to your PR.
* Remember to run `cargo fmt` and `cargo cranky`.
* 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/3466>.
2024-01-07 08:54:10 +01:00
Emil Ernerfeldt b6fe244810
Fix: apply edited `DragValue` when it looses focus (#3776)
* Closes https://github.com/emilk/egui/issues/2877
* Closes https://github.com/emilk/egui/pull/3451
2024-01-06 23:51:51 +01:00
jayzhudev e13cc69d76
Add a public API for overriding plot legend traces' visibilities (#3534)
Added a public API in `egui_plot -> legend` to allow `hidden_items` to
be overridden in the plot legend widget. This allows convenient control
of traces' visibilities the selection of traces from the application
code.

### Example
```rust
    let legend_config = if plot_selection_changed {
        let hidden_items = match plot_selection {
            PlotSelection::SelectAll => Vec::new(),
            PlotSelection::DeselectAll => all_trace_names,
        };

        Legend::default()
            .position(Corner::RightTop)
            .hidden_items(hidden_items) // Overrides `hidden_items`
    } else {
        Legend::default().position(Corner::RightTop)
    };

    Plot::new(id)
        .legend(legend_config)
        .show(ui, draw_plot);
```

Closes <https://github.com/emilk/egui/issues/3533>.

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-01-06 22:35:54 +01:00
YgorSouza 5ed2c0aa90
Plot custom zoom (#2714)
<!--
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.
* If applicable, add a screenshot or gif.
* Unless this is a trivial change, add a line to the relevant
`CHANGELOG.md` under "Unreleased".
* If it is a non-trivial addition, consider adding a demo for it to
`egui_demo_lib`.
* Remember to run `cargo fmt` and `cargo clippy`.
* Open the PR as a draft until you have self-reviewed it and run
`./sh/check.sh`.
* When you have addressed a PR comment, mark it as resolved.

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

- Added methods to zoom the plot programmatically, to match the
previously added `translate_bounds()`.
- Added an example of how this method can be used to customize the plot
navigation.

Closes #1164.
2024-01-06 22:34:42 +01:00
YgorSouza 797406de39
Add indeterminate state to checkbox (#3605)
<!--
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.
* 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 add commits to your PR.
* Remember to run `cargo fmt` and `cargo cranky`.
* 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!
-->
2024-01-06 22:34:23 +01:00
Varphone Wong 932fdae9e6
Fix: allow using the full Private Use Area for custom fonts (#3509)
The ignored characters are used in some custom fonts.

for example: the \u{F0FF} is used as `cleaning_services` in
MaterialIcons-Regular.ttf

<!--
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.
* 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 add commits to your PR.
* Remember to run `cargo fmt` and `cargo cranky`.
* 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 you PR, but my time is limited!
-->

Closes <https://github.com/emilk/egui/issues/THE_RELEVANT_ISSUE>.

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-01-06 22:33:08 +01:00
Lauro Oyen 5a6d1cbd58
Implement table row selection and hover highlighting (#3347)
* Based on #3105 by @vvv.

## Additions and Changes

- Add `TableBuilder::sense()` and `StripBuilder::sense()` to enable
detecting clicks or drags on table and strip cells.
- Add `TableRow::select()` which takes a boolean that sets the highlight
state for all cells added after a call to it. This allows highlighting
an entire row or specific cells.
- Add `TableRow::response()` which returns the union of the `Response`
of all cells added to the row up to that point. This makes it easy to
detect interactions with an entire row. See below for an alternative
design.
- Add `TableRow::index()` and `TableRow::col_index()` helpers.
- Remove explicit `row_index` from callback passed to
`TableBody::rows()` and `TableBody::heterogeneous_rows()`, possible due
to the above. This is a breaking change but makes the callback
compatible with `TableBody::row()`.
- Update Table example to demonstrate all of the above.

## Design Decisions

An alternative design to `TableRow::response()` would be to return the
row response from `TableBody`s `row()`, `rows()` and
`heterogeneous_rows()` functions. `row()` could just return the
response. `rows()` and `heterogeneous_rows()` could return a tuple of
the hovered row index and that rows response. I feel like this might be
the cleaner soluction if only returning the hovered rows response isn't
too limiting.

I didn't implement `TableBuilder::select_rows()` as described
[here](https://github.com/emilk/egui/pull/3105#issuecomment-1618062533)
because it requires an immutable borrow of the selection state for the
lifetime of the `TableBuilder`. This makes updating the selection state
from within the body unnecessarily complicated. Additionally the current
design allows for selecting specific cells, though that could be
possible by modifying `TableBuilder::select_rows()` to provide row and
column indices like below.

```rust
pub fn select_cells(is_selected: impl Fn(usize, usize) -> bool) -> Self
```

## Hover Highlighting

EDIT: Thanks to @samitbasu we now have hover highlighting too.

~This is not implemented yet. Ideally we'd have an api that allows to
choose between highlighting the hovered cell, column or row. Should
cells containing interactive widgets, be highlighted when hovering over
the widget or only when hovering over the cell itself? I'd like to
implement that before this gets merged though.~

Feedback is more than welcome. I'd be happy to make any changes
necessary to get this merged.

* Closes #1519
* Closes #1553
* Closes #3069

---------

Co-authored-by: Samit Basu <basu.samit@gmail.com>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-01-06 18:10:34 +01:00
Fredrik Fornwall 37762f72ff
Allow arrow keys to move away focus from a Slider (#3641) 2024-01-06 17:39:34 +01:00
Emil Ernerfeldt 9faf4b44ff
Ignore extra SHIFT and ALT when matching modifiers (#3769)
* Closes https://github.com/emilk/egui/issues/3626

Basically, egui now ignores extra SHIFT and ALT pressed when matching
keyboard shortcuts.
This is because SHIFT and ALT are often requires to produce some logical
keys.
For instance, typing `+` on an English keyboard requires pressing `SHIFT
=`,
so the keyboard shortcut looking for `CTRL +` should ignore the SHIFT
key.

@abey79 You reported problem using `Cmd +` and `Cmd -` to zoom - does
this fix it for you?

You can run with `RUST_LOG=egui_winit=trace cargo run` to see a printout
of how winit reports the logical and physical keys, and how egui
interprets them.

Weirdly, on Mac winit reports `SHIFT =` as `+`, but `CMD SHIFT =` as `=`
(on an English keyboard) so things are… difficult.
2024-01-05 10:53:14 +01:00
Frank Lee 1efa660149
Fix IME input of `CompositionEnd` without a `CompositionStart` (#3768)
* Closes https://github.com/emilk/egui/issues/3766

Add support for type in CompositionEnd only characters without trigger
CompositionStart first.
This usually works with no-latin character input.

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-01-04 15:47:49 +01:00
Emil Ernerfeldt f25e4171b9
Fix: don't open context menu on drag (#3767)
This fixes a bug where the context menu would open when dragging with
the secondary mouse button.

Now the context menu requires a click to open.

This is important for things like plots, where right-click and
right-drag means different things.
2024-01-04 10:29:52 +01:00
Emil Ernerfeldt 34c341444f
Release `egui_plot` 0.24.2 (#3763)
## Changelog
* Fix plot auto-bounds default
[#3722](https://github.com/emilk/egui/pull/3722) (thanks
[@abey79](https://github.com/abey79)!)

---------

Co-authored-by: Antoine Beyeler <49431240+abey79@users.noreply.github.com>
2024-01-03 09:42:56 +01:00
Daniel Buch Hansen e2c1d9f90d
Bump `winit` to `0.29.7` (#3753)
Compiled changelog below:

 - On X11, fix Xft.dpi reload during runtime.
 - On X11, fix window minimize.

- On Web, fix context menu not being disabled by
with_prevent_default(true).
- On Wayland, fix WindowEvent::Destroyed not being delivered after
destroying window.
- Fix EventLoopExtRunOnDemand::run_on_demand not working for consequent
invocation

 - On macOS, remove spurious error logging when handling Fn.
 - On X11, fix an issue where floating point data from the server is
 - misinterpreted during a drag and drop operation.
 - On X11, fix a bug where focusing the window would panic.
 - On macOS, fix refresh_rate_millihertz.
- On Wayland, disable Client Side Decorations when wl_subcompositor is
not supported.
 - On X11, fix Xft.dpi detection from Xresources.
- On Windows, fix consecutive calls to
window.set_fullscreen(Some(Fullscreen::Borderless(None))) resulting in
losing previous window state when eventually exiting fullscreen using
window.set_fullscreen(None).
 - On Wayland, fix resize being sent on focus change.
 - On Windows, fix set_ime_cursor_area.
2024-01-02 07:27:52 +01:00
Emil Ernerfeldt 5cf8a085e3 Document that you need to install additional fonts for asian scripts 2023-12-31 10:27:42 +01:00
Emil Ernerfeldt 12468438a3
`eframe`: Fix building the `wasm32` docs for `docs.rs` (#3757)
* Closes https://github.com/emilk/egui/issues/3756

Fix suggested by @morionelab
2023-12-31 10:26:02 +01:00
Emil Ernerfeldt 9951fe0d36
Fix some clippy 1.75 lints (#3754) 2023-12-30 11:23:21 +01:00
Emil Ernerfeldt 4487f8ff9f
Rename `TextBuffer::replace` to `replace_with` (#3751)
This removes the name conflict with `str::replace`.

* Closes https://github.com/emilk/egui/issues/3746
2023-12-29 17:22:39 +01:00
Emil Ernerfeldt 239ade9a59
Fix crash due to assertion during image loading from http (#3750)
* Closes https://github.com/emilk/egui/issues/3747
2023-12-29 17:20:52 +01:00
Daniel Buch Hansen f4102c05e6
Add missing `ResizeDirection::East` (#3749)
<!--
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.
* 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 add commits to your PR.
* Remember to run `cargo fmt` and `cargo cranky`.
* 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!
-->
This adds the missing variant described in below issue.
Closes <https://github.com/emilk/egui/issues/3748>.

If you wish - or even desired - I could look into implement the From
conversion between ResizeDirection and CursorInfo in a seperate PR.

I ran into an issue then running `check.sh` however it seems unrelated
to this PR.
For clarity I'm running Linux, with a wayland compositor.

```bash
~/dev/rust/egui ❯ cargo clean                                                                                                                                                      [add-missing-resizedirection ≡]
~/dev/rust/egui ❯ ./scripts/check.sh                                                                                                                                               [add-missing-resizedirection ≡]
+ cargo install --quiet cargo-cranky
+ cargo install --quiet typos-cli
+ export 'RUSTFLAGS=--cfg=web_sys_unstable_apis -D warnings'
+ RUSTFLAGS='--cfg=web_sys_unstable_apis -D warnings'
+ export 'RUSTDOCFLAGS=-D warnings'
+ RUSTDOCFLAGS='-D warnings'
+ typos
+ ./scripts/lint.py
./scripts/lint.py finished without error
+ cargo fmt --all -- --check
+ cargo doc --quiet --lib --no-deps --all-features
+ cargo doc --quiet --document-private-items --no-deps --all-features
+ cargo cranky --quiet --all-targets --all-features -- -D warnings
+ ./scripts/clippy_wasm.sh
+ export CLIPPY_CONF_DIR=scripts/clippy_wasm
+ CLIPPY_CONF_DIR=scripts/clippy_wasm
+ cargo cranky --quiet --all-features --target wasm32-unknown-unknown --target-dir target_wasm -p egui_demo_app --lib -- --deny warnings
+ cargo check --quiet --all-targets
+ cargo check --quiet --all-targets --all-features
+ cargo check --quiet -p egui_demo_app --lib --target wasm32-unknown-unknown
+ cargo check --quiet -p egui_demo_app --lib --target wasm32-unknown-unknown --all-features
+ cargo test --quiet --all-targets --all-features

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 4 tests
i...
test result: ok. 3 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 14 tests
..............
test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s


running 1 test
.
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 3 tests
...
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.52s

Testing demo_with_tessellate__realistic
Success

Testing demo_no_tessellate
Success

Testing demo_only_tessellate
Success

Testing label &str
Success

Testing label format!
Success

Testing Painter::rect
Success

Testing text_layout_uncached
Success

Testing text_layout_cached
Success

Testing tessellate_text
Success


running 3 tests
...
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 1 test
.
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 7 tests
.......
test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 23 tests
.......................
test result: ok. 23 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.20s

Testing single_dashed_lines
Success

Testing many_dashed_lines
Success

Testing tessellate_circles_100k
Success


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

+ cargo test --quiet --doc

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 4 tests
....
test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.26s


running 146 tests
........................................................................................ 88/146
i.........................................................
test result: ok. 145 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 108.27s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 5 tests
iiii.
test result: ok. 1 passed; 0 failed; 4 ignored; 0 measured; 0 filtered out; finished in 3.65s


running 5 tests
.....
test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 11.99s


running 2 tests
..
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.06s


running 5 tests
ii...
test result: ok. 3 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 2.53s


running 11 tests
...........
test result: ok. 11 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.38s


running 5 tests
i....
test result: ok. 4 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 1.01s

+ cd crates/eframe
+ cargo check --quiet --no-default-features --features glow
+ cd crates/eframe
+ cargo check --quiet --no-default-features --features wgpu
error: The platform you're compiling for is not supported by winit
  --> /home/dbuch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/platform_impl/mod.rs:67:1
   |
67 | compile_error!("The platform you're compiling for is not supported by winit");
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0432]: unresolved import `self::platform`
  --> /home/dbuch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/platform_impl/mod.rs:26:15
   |
26 | pub use self::platform::*;
   |               ^^^^^^^^ could not find `platform` in `self`

error[E0432]: unresolved import `crate::platform_impl::PlatformIcon`
 --> /home/dbuch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/icon.rs:1:5
  |
1 | use crate::platform_impl::PlatformIcon;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `PlatformIcon` in `platform_impl`

error[E0433]: failed to resolve: could not find `DeviceId` in `platform_impl`
   --> /home/dbuch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/event.rs:616:42
    |
616 |         DeviceId(unsafe { platform_impl::DeviceId::dummy() })
    |                                          ^^^^^^^^ could not find `DeviceId` in `platform_impl`

error[E0433]: failed to resolve: could not find `WindowId` in `platform_impl`
  --> /home/dbuch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/window.rs:99:42
   |
99 |         WindowId(unsafe { platform_impl::WindowId::dummy() })
   |                                          ^^^^^^^^ could not find `WindowId` in `platform_impl`

error[E0433]: failed to resolve: could not find `Window` in `platform_impl`
   --> /home/dbuch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/window.rs:513:28
    |
513 |             platform_impl::Window::new(&window_target.p, self.window, self.platform_specific)?;
    |                            ^^^^^^ could not find `Window` in `platform_impl`

error[E0412]: cannot find type `OsError` in module `platform_impl`
  --> /home/dbuch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/error.rs:28:27
   |
28 |     error: platform_impl::OsError,
   |                           ^^^^^^^ not found in `platform_impl`
   |
help: there is an enum variant `crate:🪟:BadIcon::OsError`; try using the variant's enum
   |
28 |     error: crate:🪟:BadIcon,
   |            ~~~~~~~~~~~~~~~~~~~~~~

error[E0412]: cannot find type `OsError` in module `platform_impl`
  --> /home/dbuch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/error.rs:62:76
   |
62 |     pub(crate) fn new(line: u32, file: &'static str, error: platform_impl::OsError) -> OsError {
   |                                                                            ^^^^^^^ not found in `platform_impl`
   |
help: there is an enum variant `crate:🪟:BadIcon::OsError`; try using the variant's enum
   |
62 |     pub(crate) fn new(line: u32, file: &'static str, error: crate:🪟:BadIcon) -> OsError {
   |                                                             ~~~~~~~~~~~~~~~~~~~~~~

error[E0412]: cannot find type `DeviceId` in module `platform_impl`
   --> /home/dbuch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/event.rs:602:47
    |
602 | pub struct DeviceId(pub(crate) platform_impl::DeviceId);
    |                                               ^^^^^^^^ not found in `platform_impl`

error[E0412]: cannot find type `KeyEventExtra` in module `platform_impl`
   --> /home/dbuch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/event.rs:787:50
    |
787 |     pub(crate) platform_specific: platform_impl::KeyEventExtra,
    |                                                  ^^^^^^^^^^^^^ not found in `platform_impl`

error[E0412]: cannot find type `EventLoop` in module `platform_impl`
  --> /home/dbuch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/event_loop.rs:41:43
   |
41 |     pub(crate) event_loop: platform_impl::EventLoop<T>,
   |                                           ^^^^^^^^^ not found in `platform_impl`
   |
help: consider importing this struct
   |
10 + use calloop::EventLoop;
   |
help: if you import `EventLoop`, refer to it directly
   |
41 -     pub(crate) event_loop: platform_impl::EventLoop<T>,
41 +     pub(crate) event_loop: EventLoop<T>,
   |

error[E0412]: cannot find type `EventLoopWindowTarget` in module `platform_impl`
  --> /home/dbuch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/event_loop.rs:52:34
   |
52 |     pub(crate) p: platform_impl::EventLoopWindowTarget<T>,
   |                                  ^^^^^^^^^^^^^^^^^^^^^ not found in `platform_impl`

error[E0412]: cannot find type `PlatformSpecificEventLoopAttributes` in module `platform_impl`
  --> /home/dbuch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/event_loop.rs:62:50
   |
62 |     pub(crate) platform_specific: platform_impl::PlatformSpecificEventLoopAttributes,
   |                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `platform_impl`

error[E0433]: failed to resolve: could not find `EventLoop` in `platform_impl`
   --> /home/dbuch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/event_loop.rs:128:40
    |
128 |             event_loop: platform_impl::EventLoop::new(&mut self.platform_specific)?,
    |                                        ^^^^^^^^^ could not find `EventLoop` in `platform_impl`
    |
help: consider importing this struct
    |
10  + use calloop::EventLoop;
    |
help: if you import `EventLoop`, refer to it directly
    |
128 -             event_loop: platform_impl::EventLoop::new(&mut self.platform_specific)?,
128 +             event_loop: EventLoop::new(&mut self.platform_specific)?,
    |

error[E0412]: cannot find type `EventLoopProxy` in module `platform_impl`
   --> /home/dbuch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/event_loop.rs:394:38
    |
394 |     event_loop_proxy: platform_impl::EventLoopProxy<T>,
    |                                      ^^^^^^^^^^^^^^ not found in `platform_impl`

error[E0412]: cannot find type `VideoMode` in module `platform_impl`
  --> /home/dbuch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/monitor.rs:18:43
   |
18 |     pub(crate) video_mode: platform_impl::VideoMode,
   |                                           ^^^^^^^^^ not found in `platform_impl`

error[E0412]: cannot find type `MonitorHandle` in module `platform_impl`
   --> /home/dbuch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/monitor.rs:104:38
    |
104 |     pub(crate) inner: platform_impl::MonitorHandle,
    |                                      ^^^^^^^^^^^^^ not found in `platform_impl`

error[E0412]: cannot find type `VideoMode` in this scope
  --> /home/dbuch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/platform_impl/mod.rs:31:15
   |
31 |     Exclusive(VideoMode),
   |               ^^^^^^^^^ not found in this scope
   |
help: consider importing this struct
   |
1  + use crate::monitor::VideoMode;
   |

error[E0412]: cannot find type `MonitorHandle` in this scope
   --> /home/dbuch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/platform_impl/mod.rs:32:23
    |
32  |     Borderless(Option<MonitorHandle>),
    |                       ^^^^^^^^^^^^^
    |
   ::: /home/dbuch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/monitor.rs:103:1
    |
103 | pub struct MonitorHandle {
    | ------------------------ similarly named struct `RootMonitorHandle` defined here
    |
help: a struct with a similar name exists
    |
32  |     Borderless(Option<RootMonitorHandle>),
    |                       ~~~~~~~~~~~~~~~~~
help: consider importing this struct
    |
1   + use crate::monitor::MonitorHandle;
    |

error[E0412]: cannot find type `Window` in module `platform_impl`
  --> /home/dbuch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/window.rs:55:39
   |
55 |     pub(crate) window: platform_impl::Window,
   |                                       ^^^^^^ not found in `platform_impl`

error[E0412]: cannot find type `WindowId` in module `platform_impl`
  --> /home/dbuch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/window.rs:85:47
   |
85 | pub struct WindowId(pub(crate) platform_impl::WindowId);
   |                                               ^^^^^^^^ not found in `platform_impl`

error[E0412]: cannot find type `PlatformSpecificWindowBuilderAttributes` in module `platform_impl`
   --> /home/dbuch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/window.rs:123:50
    |
123 |     pub(crate) platform_specific: platform_impl::PlatformSpecificWindowBuilderAttributes,
    |                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `platform_impl`

error[E0282]: type annotations needed
   --> /home/dbuch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/window.rs:537:17
    |
537 |         builder.build(event_loop)
    |                 ^^^^^ cannot infer type of the type parameter `T` declared on the method `build`
    |
help: consider specifying the generic argument
    |
537 |         builder.build::<T>(event_loop)
    |                      +++++

Some errors have detailed explanations: E0282, E0412, E0432, E0433.
For more information about an error, try `rustc --explain E0282`.
error: could not compile `winit` (lib) due to 23 previous errors
~/dev/rust/egui ❯                                                                                                                                                                  [add-missing-resizedirection ≡]
```
2023-12-29 16:59:29 +01:00
Emil Ernerfeldt e44f54f81f
Fix text color of disabled widgets (#3744)
* Introduced recently in https://github.com/emilk/egui/pull/3727
* Closes https://github.com/emilk/egui/issues/3732
2023-12-28 11:16:39 +01:00
Emil Ernerfeldt 9dbfb8ce4e Make check.sh more quiet 2023-12-28 10:38:07 +01:00
Emil Ernerfeldt 790b401adf Add -g option to build_demo_web.sh 2023-12-28 10:36:07 +01:00
Emil Ernerfeldt d978b37732 Improve CONTRIBUTING.md 2023-12-28 09:33:16 +01:00
Marijn Suijten 5b591d26f6
Add `Key::Cut`, `Key::Copy`, `Key::Paste` (#3725)
The comment added in commit 8a0bc97e ("[egui_glium] Fix paste") seems to
assume that `winit` "should have translated" common "paste" keyboard
combos to a `Cut`/`Copy`/`Paste` "KeyCode", but completely glossed over
the fact that this `KeyCode` (now also `NamedKey`) maps to a special key
dedicated to this purpose found on some keyboards and OSes. Make sure
that this key is still handled in addition to the combo that is
detected.

---

Note that this PR does not compile as it is (and I have hence not tested
this nor even ran into this limitation), just noticed this inconsistency
while failing to understand a code comment. We'd have to decide if the
variants should be added to `egui::Key` or if these helper functions
need to take `winit` keys (`ScanCode` or `NamedKey`) directly?

I should have an old keyboard with a physical paste key in a drawer
somewhere. And on Android there are special copy/paste events that can
be sent by a virtual keyboard or the debug shell, so that this can be
properly tested before it is merged.
(Except that the current `clipboard` implementation is not supported on
Android)
2023-12-25 19:02:02 +01:00
Arnold Loubriat c3a9355279
Fix: Let `accesskit` process window events (#3733)
<!--
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.
* 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 add commits to your PR.
* Remember to run `cargo fmt` and `cargo cranky`.
* 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!
-->

Since accesskit_winit version 0.15.0, it is necessary to call
`Adapter::process_events` to let AccessKit fire up window focus events
on Unix and macOS. Furthermore this has always been needed on Unix (X11
only) to let AccessKit know about the window bounds, which is needed to
perform hit-testing on nodes.
2023-12-25 19:01:05 +01:00
Emil Ernerfeldt 0a6ea15f6c
impl `Clone` for `Fonts` (#3737)
Closes https://github.com/emilk/egui/issues/3731
2023-12-25 19:00:54 +01:00
Oscar Gustafsson fc18d6f8f4
Add support for dashed lines with offset (#3720)
<!--
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.
* 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 add commits to your PR.
* Remember to run `cargo fmt` and `cargo cranky`.
* 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/3677>.

This can naturally be obtained by starting the drawing a bit "later",
but providing support for this directly will simplify interleaved
drawing of dashed lines.

An even more general approach would be to allow passing an even-length
vector of lengths and gaps, in addition to offset. Primarily thinking if
it is better to go even further if a new dashed-line-method is
introduced. The second commit introduce this (I can naturally squash
these!).
2023-12-23 16:17:04 +01:00
Wybe Westra 76025f2c15
Fix: `Grid` now follows `style.visuals.striped` setting if not explicitly overwritten (#3723)
The docs of
[`Visuals.striped`](https://docs.rs/egui/latest/egui/style/struct.Visuals.html#structfield.striped)
mention that they control the default striping of Grid. However, this
seems to be broken.

This pr makes the Grid follow the striped setting if it doesn't yet have
a row coloring set.
2023-12-23 15:58:48 +01:00
Antoine Beyeler 365a8d2240
Fix `Window` positioning bug when bad `pivot` is stored in app data (#3721)
This PR fixes an issue where a bad pivot stored in app state would
override the pivot actually set from code. The root code of this issue
if the `Window`'s `State` containing `pivot` in the first place, as
`pivot` is not part of a state to be tracked. It makes the `State`
structure more ergonomic though, so this PR leaves the `pivot` field but
always overrides it with the value provided by user code.

#### Repro of the original issue

This issue can be reproduced using the `re_ui_example` app from the
Rerun repo, at this commit:
fb5add0047.
By using this `app.ron` file, the bug will appear:

```
{
    "egui": "(
      areas:{
            ((0)):(
                areas:{
                    (13430889033718688666):(pivot_pos:(x:565.5,y:328.0),pivot:((Min,Min)),size:(x:364.0,y:75.5),interactable:true),
                },
            )
        }
    )",
}
```

The modal is entered based on it's top-left corner even though the code
actually specifies a center-center pivot:

<img width="1312" alt="image"
src="https://github.com/emilk/egui/assets/49431240/6df1a8bb-d1ea-4e15-866c-5f14138dda0e">

With this PR, the centring is correct even with the "poisoned"
`app.ron`:

<img width="1312" alt="image"
src="https://github.com/emilk/egui/assets/49431240/7f50b2d4-9245-48f3-91de-c747bbc8c40e">
2023-12-23 15:53:40 +01:00
Emil Ernerfeldt ffcc3f066c Typos and doc improvements 2023-12-22 17:33:01 +01:00
Emil Ernerfeldt 0561fcaba9
Replace a special `Color32::PLACEHOLDER` with widget fallback color (#3727)
This introduces a special `Color32::PLACEHOLDER` which, during text
painting, will be replaced with `TextShape::fallback_color`.

The fallback color is mandatory to set in all text painting. Usually
this comes from the current visual style.

This lets users color only parts of a `WidgetText` (using e.g. a
`LayoutJob` or a `Galley`), where the uncolored parts (using
`Color32::PLACEHOLDER`) will be replaced by a default widget color (e.g.
blue for a hyperlink).

For instance, you can color the `⚠️`-emoji red in a piece of text red
and leave the rest of the text uncolored. The color of the rest of the
text will then depend on wether or not you put that text in a label, a
button, or a hyperlink.

Overall this simplifies a lot of complexity in the code but comes with a
few breaking changes:

* `TextShape::new`, `Shape::galley`, and `Painter::galley` now take a
fallback color by argument
* `Shape::galley_with_color` has been deprecated (use `Shape::galley`
instead)
* `Painter::galley_with_color` has been deprecated (use
`Painter::galley` instead)
* `WidgetTextGalley` is gone (use `Arc<Galley>` instead)
* `WidgetTextJob` is gone (use `LayoutJob` instead)
* `RichText::into_text_job` has been replaced with
`RichText::into_layout_job`
* `WidgetText::into_text_job` has been replaced with
`WidgetText::into_layout_job`
2023-12-22 15:09:10 +01:00
Emil Ernerfeldt e36b981118
Add @Bromeon and @EmbersArc as CODEOWNERS for egui_plot (#3711)
Please take a look @Bromeon and @EmbersArc!

You have both contributed substantially to `egui_plot` (more than I
have).
This is me inviting you to co-maintain the `egui_plot` crate.
If you accept, you'll get a notification when someone opens a PR
touching `egui_plot`, and you can review and merge it as you see fit.
You can also merge your own egui_plot PRs without waiting on me to
review them.
2023-12-21 09:08:16 +01:00
PingPongun 963be247f2
Update resvg dependency of egui_extras (#3719)
Update `resvg` from v0.28 to v0.37. 
Remove related, unnecessary entries from `deny.toml`.

⚠ In example `images` ferris is scaled differently, but I guess that now
it scales in expected way (takes all available space; before this PR it
takes up to space that, was available at first render- it does not
upscale).

This PR is minimal adaptation to new `resvg` api and small related
simplification, however it should be considered to update loaders
(currently if svg image initially was small and was scaled up it will be
blurred, see https://github.com/emilk/egui/issues/3501). As svg image
now scales over render size, problem will be more often seen now.

(currently `SvgLoader` theoretically should rerender for different sizes
(but I guess it will result in memory leak in that case), but refreshing
is stopped earlier in `DefaultTextureLoader`).

I have initial version of loaders update, that will fix issue with svg
scaling (and also enable e.g. reloading image if file has been changed),
I will submit these changes in separate PR once this one is merged.

Closes <https://github.com/emilk/egui/issues/3652>.
2023-12-20 08:09:03 +01:00
Antoine Beyeler add1695624
Fix plot auto-bounds unset by default (#3722)
These PR recently cleaned up the code around auto-bounds, but introduced
an involuntary change whereby auto-bounds would not be enabled by
default. All plots would default to being not properly centred as a
result.

- #3587
- #3586

This PR changes the default back to enabled. It also deprecates
`auto_bounds_x()` and `auto_bounds_y()`, which could only enable
auto-bounds (which is not very useful as auto-bounds were, and now are
again, enabled by default). A new `auto_bounds()` API can now be sued to
disable auto-bounds if needed.

Fixes #3712 
Fixes https://github.com/rerun-io/rerun/issues/4503
2023-12-19 17:58:59 +01:00
Emil Ernerfeldt 9253cafedd
`eframe`: If both `glow` and `wgpu` features are enabled, default to `wgpu` (#3717)
By default, only the `glow` feature is enabled, so if the user added
`wgpu` to the feature list they probably wanted to use `wgpu`.
2023-12-19 09:51:05 +01:00