From a7e9e209744c3cbc61a5cd9ad3eee60f249b5eb7 Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauld.mccarthy@gmail.com> Date: Tue, 8 Mar 2016 14:00:09 +0000 Subject: [PATCH] Selection cursor is only drawn on the target canvas on mouse moves. Greatly improves performance when running over X11 --- fsl/fsleyes/profiles/orthoeditprofile.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/fsl/fsleyes/profiles/orthoeditprofile.py b/fsl/fsleyes/profiles/orthoeditprofile.py index b0ecc4578..f547e1950 100644 --- a/fsl/fsleyes/profiles/orthoeditprofile.py +++ b/fsl/fsleyes/profiles/orthoeditprofile.py @@ -840,16 +840,16 @@ class OrthoEditProfile(orthoviewprofile.OrthoViewProfile): On all lower performance settings, only the source canvas is updated. """ perf = self._viewPanel.getSceneOptions().performance - if perf == 4: - if mousePos is None or canvasPos is None: - self._viewPanel.Refresh() - - # If running in high performance mode, we make - # the canvas location track the edit cursor - # location, so that the other two canvases - # update to display the current cursor location. - else: - self._navModeLeftMouseDrag(ev, canvas, mousePos, canvasPos) + + # If running in high performance mode, we make + # the canvas location track the edit cursor + # location, so that the other two canvases + # update to display the current cursor location. + if perf == 4 and \ + (mousePos is not None) and \ + (canvasPos is not None): + self._navModeLeftMouseDrag(ev, canvas, mousePos, canvasPos) + else: canvas.Refresh() -- GitLab