Skip to content

Commit 4314d47

Browse files
committed
Remove settings that controlled interactivity in UI
Specifically, take out scroll_pan, click_drag, and click_center
1 parent b9891ac commit 4314d47

File tree

3 files changed

+0
-63
lines changed

3 files changed

+0
-63
lines changed

src/astro_image_display_api/dummy_viewer.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ class ImageViewer:
2222
# These are attributes, not methods. The type annotations are there
2323
# to make sure Protocol knows they are attributes. Python does not
2424
# do any checking at all of these types.
25-
_click_center: bool = False
26-
_click_drag: bool = True
27-
scroll_pan: bool = False
2825
image_width: int = 0
2926
image_height: int = 0
3027
zoom_level: float = 1
@@ -47,32 +44,11 @@ class ImageViewer:
4744

4845
# some internal variable for keeping track of viewer state
4946
_interactive_marker_name: str = ""
50-
_previous_click_center: bool = False
51-
_previous_click_drag: bool = True
52-
_previous_scroll_pan: bool = False
5347
_previous_marker: Any = ""
5448
_markers: dict[str, Table] = field(default_factory=dict)
5549
_wcs: WCS | None = None
5650
_center: tuple[float, float] = (0.0, 0.0)
5751

58-
# Some properties where we need to control what happens
59-
@property
60-
def click_center(self) -> bool:
61-
return self._click_center
62-
63-
@click_center.setter
64-
def click_center(self, value: bool) -> None:
65-
self._click_center = value
66-
self._click_drag = not value
67-
68-
@property
69-
def click_drag(self) -> bool:
70-
return self._click_drag
71-
@click_drag.setter
72-
def click_drag(self, value: bool) -> None:
73-
self._click_drag = value
74-
self._click_center = not value
75-
7652
@property
7753
def stretch(self) -> str:
7854
return self._stretch

src/astro_image_display_api/interface_definition.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ class ImageViewerInterface(Protocol):
2727
# These are attributes, not methods. The type annotations are there
2828
# to make sure Protocol knows they are attributes. Python does not
2929
# do any checking at all of these types.
30-
click_center: bool
31-
click_drag: bool
32-
scroll_pan: bool
3330
image_width: int
3431
image_height: int
3532
zoom_level: float

src/astro_image_display_api/widget_api_test.py

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -315,42 +315,6 @@ def test_cursor(self):
315315
self.image.cursor = 'bottom'
316316
assert self.image.cursor == 'bottom'
317317

318-
def test_click_drag(self):
319-
# Set this to ensure that click_drag turns it off
320-
self.image.click_center = True
321-
322-
# Make sure that setting click_drag to False does not turn off
323-
# click_center.
324-
self.image.click_drag = False
325-
assert self.image.click_center
326-
327-
self.image.click_drag = True
328-
assert not self.image.click_center
329-
330-
# If is_marking is true then trying to enable click_drag should fail
331-
self.image.click_drag = False
332-
333-
def test_click_center(self):
334-
# Set this to ensure that click_center turns it off
335-
self.image.click_drag = True
336-
337-
# Make sure that setting click_center to False does not turn off
338-
# click_drag.
339-
self.image.click_center = False
340-
assert self.image.click_drag
341-
342-
self.image.click_center = True
343-
assert not self.image.click_drag
344-
345-
self.image.click_center = False
346-
347-
348-
def test_scroll_pan(self):
349-
# Make sure scroll_pan is actually settable
350-
for value in [True, False]:
351-
self.image.scroll_pan = value
352-
assert self.image.scroll_pan is value
353-
354318
def test_save(self, tmp_path):
355319
filename = tmp_path / 'woot.png'
356320
self.image.save(filename)

0 commit comments

Comments
 (0)