1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 06:10:06 -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

@@ -4,9 +4,9 @@ use std::ops::RangeInclusive;
use egui::*;
use egui_plot::{
Arrows, AxisBools, AxisHints, Bar, BarChart, BoxElem, BoxPlot, BoxSpread, CoordinatesFormatter,
Corner, GridInput, GridMark, HLine, Legend, Line, LineStyle, MarkerShape, Plot, PlotImage,
PlotPoint, PlotPoints, PlotResponse, Points, Polygon, Text, VLine,
Arrows, AxisHints, Bar, BarChart, BoxElem, BoxPlot, BoxSpread, CoordinatesFormatter, Corner,
GridInput, GridMark, HLine, Legend, Line, LineStyle, MarkerShape, Plot, PlotImage, PlotPoint,
PlotPoints, PlotResponse, Points, Polygon, Text, VLine,
};
// ----------------------------------------------------------------------------
@@ -830,8 +830,8 @@ impl Default for Chart {
struct ChartsDemo {
chart: Chart,
vertical: bool,
allow_zoom: AxisBools,
allow_drag: AxisBools,
allow_zoom: Vec2b,
allow_drag: Vec2b,
}
impl Default for ChartsDemo {