Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions carta/wcs_overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SessionWCSOverlay(BasePathMixin):

def __init__(self, session):
self.session = session
self._base_path = "overlayStore"
self._base_path = "overlaySettings"

self._components = {}
for component in Overlay:
Expand Down Expand Up @@ -104,7 +104,7 @@ def set_view_area(self, width, height):
height : {1}
The new height, in pixels, divided by the device pixel ratio.
"""
self.call_action("setViewDimension", width, height)
self.session.call_action("setImageViewDimensions", width, height)


class OverlayComponent(BasePathMixin):
Expand All @@ -126,7 +126,7 @@ def __init_subclass__(cls, **kwargs):
OverlayComponent.CLASS[cls.COMPONENT] = cls

def __init__(self, overlay):
self._base_path = f"overlayStore.{self.COMPONENT}"
self._base_path = f"overlaySettings.{self.COMPONENT}"
self.session = overlay.session


Expand Down
9 changes: 7 additions & 2 deletions tests/test_wcs_overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ def func(comp_enum, mock_value=None):
return func


@pytest.fixture
def session_call_action(session, mock_call_action):
return mock_call_action(session)


@pytest.fixture
def session_get_value(session, mock_get_value):
return mock_get_value(session)
Expand Down Expand Up @@ -106,9 +111,9 @@ def test_palette_to_rgb(overlay, session_get_value, theme_is_dark, expected_rgb)
assert rgb == expected_rgb


def test_set_view_area(overlay, call_action):
def test_set_view_area(overlay, session_call_action):
overlay.set_view_area(100, 200)
call_action.assert_called_with("setViewDimension", 100, 200)
session_call_action.assert_called_with("setImageViewDimensions", 100, 200)


# COMPONENT TESTS
Expand Down
Loading