1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 22:30:03 -04:00

Add emath::Vec2b, replacing egui_plot::AxisBools (#3543)

Thanks to `impl From<bool> for Vec2b` one can now shorten some builder
calls, like:

Previous:
```rust
 egui::ScrollArea::vertical()
        .auto_shrink([false; 2])
```

New:
```rust
 egui::ScrollArea::vertical()
        .auto_shrink(false)
```
This commit is contained in:
Emil Ernerfeldt
2023-11-11 21:31:36 +01:00
committed by GitHub
parent 03a1471ddb
commit b27aa27e94
19 changed files with 148 additions and 119 deletions

View File

@@ -1,3 +1,5 @@
use egui::Vec2b;
#[derive(Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub struct WindowOptions {
@@ -7,7 +9,7 @@ pub struct WindowOptions {
collapsible: bool,
resizable: bool,
constrain: bool,
scroll2: [bool; 2],
scroll2: Vec2b,
disabled_time: f64,
anchored: bool,
@@ -24,7 +26,7 @@ impl Default for WindowOptions {
collapsible: true,
resizable: true,
constrain: true,
scroll2: [true; 2],
scroll2: Vec2b::TRUE,
disabled_time: f64::NEG_INFINITY,
anchored: false,
anchor: egui::Align2::RIGHT_TOP,