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)
| 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" |
no test coverage detected