Ticket #5188 (closed: fixed)
ImageViewer can generate exception from invalid spectrum index
Reported by: | Dennis Mikkelson | Owned by: | Dennis Mikkelson |
---|---|---|---|
Priority: | major | Milestone: | Release 2.1 |
Component: | Mantid | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Tester: | Roman Tolchenov |
Description
Qt will return a position pointed at on a the display with the mouse, even if the mouse has moved outside of the image plot area. This will lead to an invalid spectrum index and an exception in Mantid. The row numbers must be clamped to a valid interval to avoid this problem.
Change History
comment:2 Changed 8 years ago by Dennis Mikkelson
Fix possible exception: clamp x,y,row,col to valid range.
Since Qt continues to return position information, even after the user drags the mouse outside of a drawing area, it is necessary to clamp these values to a valid range, to avoid an exception in those cases. refs #5188
Changeset: 1a0f8f583b18ce246949b139337209ea00d5d72c
comment:3 Changed 8 years ago by Dennis Mikkelson
- Status changed from accepted to verify
- Resolution set to fixed
comment:4 Changed 8 years ago by Roman Tolchenov
- Status changed from verify to verifying
- Tester set to Roman Tolchenov
comment:5 Changed 8 years ago by Roman Tolchenov
- Status changed from verifying to closed
Played with ImageViewer, it didn't crash.
comment:6 Changed 8 years ago by Dennis Mikkelson
Fix possible exception: clamp x,y,row,col to valid range.
Since Qt continues to return position information, even after the user drags the mouse outside of a drawing area, it is necessary to clamp these values to a valid range, to avoid an exception in those cases. refs #5188
Changeset: 1a0f8f583b18ce246949b139337209ea00d5d72c