Skip to content

Commit

Permalink
Only allow float or int
Browse files Browse the repository at this point in the history
  • Loading branch information
melonora committed Jun 23, 2024
1 parent 74aa262 commit e28e9d3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions napari/_qt/qt_main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -1682,6 +1682,13 @@ def export_figure(
Numpy array of type ubyte and shape (h, w, 4). Index [0, 0] is the
upper-left corner of the rendered region.
"""
if not isinstance(scale, float):
raise TypeError(
trans._(
'Scale must be a float or an int.',
deferred=True,
)
)
img = QImg2array(
self._screenshot(
scale=scale,
Expand Down

0 comments on commit e28e9d3

Please sign in to comment.