MCPcopy Create free account
hub / github.com/emilk/egui_plot / rect_from_values

Method rect_from_values

egui_plot/src/axis.rs:547–555  ·  view source on GitHub ↗

Transform a rectangle of plot values to a screen-coordinate rectangle. This typically means that the rect is mirrored vertically (top becomes bottom and vice versa), since the plot's coordinate system has +Y up, while egui has +Y down.

(&self, value1: &PlotPoint, value2: &PlotPoint)

Source from the content-addressed store, hash-verified

545 /// bottom and vice versa), since the plot's coordinate system has +Y
546 /// up, while egui has +Y down.
547 pub fn rect_from_values(&self, value1: &PlotPoint, value2: &PlotPoint) -> Rect {
548 let pos1 = self.position_from_point(value1);
549 let pos2 = self.position_from_point(value2);
550
551 let mut rect = Rect::NOTHING;
552 rect.extend_with(pos1);
553 rect.extend_with(pos2);
554 rect
555 }
556
557 /// delta position / delta value = how many ui points per step in the X axis
558 /// in "plot space"

Callers 6

find_closest_rectFunction · 0.80
add_shapesMethod · 0.80
shapesMethod · 0.80
add_shapesMethod · 0.80
tile_view_infoMethod · 0.80
find_closestMethod · 0.80

Calls 2

position_from_pointMethod · 0.80
extend_withMethod · 0.80

Tested by

no test coverage detected