mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 05:10:03 -04:00
Introduce lifetime to egui_plot::Plot to replace 'static fields (#4435)
* Closes https://github.com/emilk/egui/issues/4434 Shouldn't break anything, because when all arguments have a 'static lifetime (required without this PR), the Plot is also 'static and can be used like before.
This commit is contained in:
@@ -81,7 +81,7 @@ pub trait PlotItem {
|
||||
shapes: &mut Vec<Shape>,
|
||||
cursors: &mut Vec<Cursor>,
|
||||
plot: &PlotConfig<'_>,
|
||||
label_formatter: &LabelFormatter,
|
||||
label_formatter: &LabelFormatter<'_>,
|
||||
) {
|
||||
let points = match self.geometry() {
|
||||
PlotGeometry::Points(points) => points,
|
||||
@@ -1735,7 +1735,7 @@ impl PlotItem for BarChart {
|
||||
shapes: &mut Vec<Shape>,
|
||||
cursors: &mut Vec<Cursor>,
|
||||
plot: &PlotConfig<'_>,
|
||||
_: &LabelFormatter,
|
||||
_: &LabelFormatter<'_>,
|
||||
) {
|
||||
let bar = &self.bars[elem.index];
|
||||
|
||||
@@ -1909,7 +1909,7 @@ impl PlotItem for BoxPlot {
|
||||
shapes: &mut Vec<Shape>,
|
||||
cursors: &mut Vec<Cursor>,
|
||||
plot: &PlotConfig<'_>,
|
||||
_: &LabelFormatter,
|
||||
_: &LabelFormatter<'_>,
|
||||
) {
|
||||
let box_plot = &self.boxes[elem.index];
|
||||
|
||||
@@ -2033,7 +2033,7 @@ pub(super) fn rulers_at_value(
|
||||
plot: &PlotConfig<'_>,
|
||||
shapes: &mut Vec<Shape>,
|
||||
cursors: &mut Vec<Cursor>,
|
||||
label_formatter: &LabelFormatter,
|
||||
label_formatter: &LabelFormatter<'_>,
|
||||
) {
|
||||
if plot.show_x {
|
||||
cursors.push(Cursor::Vertical { x: value.x });
|
||||
|
||||
Reference in New Issue
Block a user