Skip to content

Commit ca233f8

Browse files
committed
Fix update_status method in cross-section tools to retrieve all image items
Fix #47
1 parent 5ae667b commit ca233f8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
🛠️ Bug fixes:
66

77
* [Issue #44](https://github.com/PlotPyStack/PlotPy/issues/44) - Incorrect calculation method for "∑(y)" in `CurveStatsTool`: replaced `spt.trapezoid` with `np.sum`, which is more consistent with the summation operation
8+
* Fix `update_status` method in all cross-section tools (intensity profile tools):
9+
* Use `get_items` instead of `get_selected_items` to retrieve the image items
10+
* This allows the tools to work properly when no image item is selected, but there are image items in the plot
11+
* This closes [Issue #47](https://github.com/PlotPyStack/PlotPy/issues/47) - Intensity profile tools do not work when no image item is selected
812

913
Other changes:
1014

plotpy/tools/cross_section.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class CrossSectionTool(RectangularShapeTool):
3333
def update_status(self, plot: BasePlot) -> None:
3434
"""Update status of the tool"""
3535
if update_image_tool_status(self, plot):
36-
item = plot.get_selected_items(item_type=IImageItemType)
36+
item = plot.get_items(item_type=IImageItemType)
3737
self.action.setEnabled(len(item) > 0)
3838

3939
def create_shape(self) -> AnnotatedPoint:

0 commit comments

Comments
 (0)