Skip to content

Commit ad8213c

Browse files
Addressing linter recommendations
1 parent 46540ae commit ad8213c

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

demo/src/plot_demo.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
use std::f64::consts::TAU;
2-
use std::ops::RangeInclusive;
31
use eframe::emath::Align2;
42
use egui::{
53
Color32, ComboBox, NumExt as _, Pos2, Response, ScrollArea, Stroke, TextWrapMode, Vec2b,
64
WidgetInfo, WidgetType, remap, vec2,
75
};
86

7+
use std::f64::consts::TAU;
8+
use std::ops::RangeInclusive;
9+
910
use egui_plot::{
1011
Arrows, AxisHints, Bar, BarChart, BoxElem, BoxPlot, BoxSpread, CoordinatesFormatter, Corner,
1112
GridInput, GridMark, HLine, Legend, Line, LineStyle, MarkerShape, Plot, PlotImage, PlotPoint,
@@ -822,7 +823,7 @@ impl ItemsDemo {
822823
Text::new("Text", PlotPoint::new(-2.0, 2.5), "so graph")
823824
.angle(-std::f32::consts::FRAC_PI_4)
824825
.anchor(Align2::CENTER_TOP)
825-
.id("text1")
826+
.id("text1"),
826827
);
827828
plot_ui.text(Text::new("Text", PlotPoint::new(3.0, 3.0), "much color").id("text2"));
828829
plot_ui.text(Text::new("Text", PlotPoint::new(2.5, -2.0), "such plot").id("text3"));

egui_plot/src/items/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,11 @@ impl PlotItem for Text {
713713
let pos = transform.position_from_point(&self.position);
714714
let rect = self.anchor.anchor_size(pos, galley.size());
715715

716-
shapes.push(TextShape::new(rect.min, galley, color).with_angle(self.angle).into());
716+
shapes.push(
717+
TextShape::new(rect.min, galley, color)
718+
.with_angle(self.angle)
719+
.into(),
720+
);
717721

718722
if self.base.highlight {
719723
shapes.push(Shape::rect_stroke(

0 commit comments

Comments
 (0)