Added plot_ui::plot_clicked() (#1372)

This commit is contained in:
zam-5 2022-03-19 08:00:18 -04:00 committed by GitHub
parent c69f39e869
commit cecb48af03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -767,6 +767,11 @@ impl PlotUi {
self.response.hovered() self.response.hovered()
} }
/// Returns `true` if the plot was clicked by the primary button.
pub fn plot_clicked(&self) -> bool {
self.response.clicked()
}
/// The pointer position in plot coordinates. Independent of whether the pointer is in the plot area. /// The pointer position in plot coordinates. Independent of whether the pointer is in the plot area.
pub fn pointer_coordinate(&self) -> Option<Value> { pub fn pointer_coordinate(&self) -> Option<Value> {
// We need to subtract the drag delta to keep in sync with the frame-delayed screen transform: // We need to subtract the drag delta to keep in sync with the frame-delayed screen transform: