Skip to content
This repository has been archived by the owner on Feb 2, 2022. It is now read-only.

Commit

Permalink
2dview: fix: Fixed a bug where moving the mouse before images are loa…
Browse files Browse the repository at this point in the history
…ded would cause an error.
  • Loading branch information
bastula committed Oct 24, 2017
1 parent ceac276 commit 7de5e5c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dicompyler/baseplugins/2dview.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,9 @@ def OnUpdatePositionValues(self, evt=None):
# Set an empty text placeholder if the coordinates are not within range
text = ""
value = ""
# Skip processing if images are not loaded
if not len(self.images):
pub.sendMessage('main.update_statusbar', msg={1:text, 2:value})
# Only display if the mouse coordinates are within the image size range
if ((0 <= xpos < len(self.structurepixlut[0])) and
(0 <= ypos < len(self.structurepixlut[1])) and self.mouse_in_window):
Expand Down

0 comments on commit 7de5e5c

Please sign in to comment.