Skip to content

Commit

Permalink
add plot_secondary_clicked to plot_ui (emilk#2318)
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc authored and JohannesProgrammiert committed Jan 21, 2023
1 parent 3e0a394 commit 5e257fb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/egui/src/widgets/plot/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,11 @@ impl PlotUi {
self.response.clicked()
}

/// Returns `true` if the plot was clicked by the secondary button.
pub fn plot_secondary_clicked(&self) -> bool {
self.response.secondary_clicked()
}

/// The pointer position in plot coordinates. Independent of whether the pointer is in the plot area.
pub fn pointer_coordinate(&self) -> Option<PlotPoint> {
// We need to subtract the drag delta to keep in sync with the frame-delayed screen transform:
Expand Down

0 comments on commit 5e257fb

Please sign in to comment.