From dbcdf7fe1eb6699babbf75dd95a45f21a79f9cdd Mon Sep 17 00:00:00 2001 From: Marcus Oskarsson Date: Mon, 14 Oct 2024 15:08:35 +0200 Subject: [PATCH] [Centring] - Fixed casing and fixed potential issue with very frequent clicking --- mxcubeweb/core/components/sampleview.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mxcubeweb/core/components/sampleview.py b/mxcubeweb/core/components/sampleview.py index e2fa4a54..1186c2c0 100644 --- a/mxcubeweb/core/components/sampleview.py +++ b/mxcubeweb/core/components/sampleview.py @@ -420,10 +420,13 @@ def abort_centring(self): def centring_handle_click(self, x, y): if HWR.beamline.diffractometer.current_centring_procedure: - HWR.beamline.diffractometer.imageClicked(x, y, x, y) + HWR.beamline.diffractometer.image_clicked(x, y, x, y) self.centring_click() else: - if not self.centring_clicks_left(): + # Number of centring clicks can still be negative if the user + # clicks very frequently on the image, added comparsion with lesser + # then 0 to be able to recover from this scenario. + if self.centring_clicks_left() <= 0: self.centring_reset_click_count() HWR.beamline.diffractometer.cancel_centring_method()