Describe the bug
The "Original size" option in the rectangular snapshot tool does not behave correctly under certain conditions:
- When the Y axis is not reversed
- When the X axis is reversed
- When using an
XYImageItem
In these cases, the "Original size" preview may display negative values or incorrect dimensions. The computation appears to rely on axis scaling rather than pixel coordinates, particularly for XYImageItem.
Additionally, a ValueError is raised when either axis leads to negative values.
To Reproduce
Steps to reproduce the behavior:
- Create a
PlotDialog with a toolbar (toolbar=True)
- Add an image of type
ImageItem or XYImageItem (make.image)
- Reverse one of the axes (via right-click)
- Select the rectangular snapshot tool
- Select a region of the image
- Enable "Original size"
Expected behavior
The rectangular snapshot tool should compute the "Original size" using pixel coordinates, independent of axis orientation or scaling.
Describe the bug
The "Original size" option in the rectangular snapshot tool does not behave correctly under certain conditions:
XYImageItemIn these cases, the "Original size" preview may display negative values or incorrect dimensions. The computation appears to rely on axis scaling rather than pixel coordinates, particularly for
XYImageItem.Additionally, a
ValueErroris raised when either axis leads to negative values.To Reproduce
Steps to reproduce the behavior:
PlotDialogwith a toolbar (toolbar=True)ImageItemorXYImageItem(make.image)Expected behavior
The rectangular snapshot tool should compute the "Original size" using pixel coordinates, independent of axis orientation or scaling.