Protect from no shown image yet
svn: r23467
This commit is contained in:
parent
f31ad236e4
commit
bd501a8357
@ -358,17 +358,21 @@ class SelectionWidget(Gtk.ScrolledWindow):
|
|||||||
"""
|
"""
|
||||||
Returns whether it is possible to zoom in the image.
|
Returns whether it is possible to zoom in the image.
|
||||||
"""
|
"""
|
||||||
scaled_size = (self.original_image_size[0] * self.scale * RESIZE_RATIO,
|
if self.original_image_size:
|
||||||
self.original_image_size[1] * self.scale * RESIZE_RATIO)
|
scaled_size = (self.original_image_size[0] * self.scale * RESIZE_RATIO,
|
||||||
return scaled_size[0] < MAX_SIZE and scaled_size[1] < MAX_SIZE
|
self.original_image_size[1] * self.scale * RESIZE_RATIO)
|
||||||
|
return scaled_size[0] < MAX_SIZE and scaled_size[1] < MAX_SIZE
|
||||||
|
return False
|
||||||
|
|
||||||
def can_zoom_out(self):
|
def can_zoom_out(self):
|
||||||
"""
|
"""
|
||||||
Returns whether it is possible to zoom out the image.
|
Returns whether it is possible to zoom out the image.
|
||||||
"""
|
"""
|
||||||
scaled_size = (self.original_image_size[0] * self.scale * RESIZE_RATIO,
|
if self.original_image_size:
|
||||||
self.original_image_size[1] * self.scale * RESIZE_RATIO)
|
scaled_size = (self.original_image_size[0] * self.scale * RESIZE_RATIO,
|
||||||
return scaled_size[0] >= MIN_SIZE and scaled_size[1] >= MIN_SIZE
|
self.original_image_size[1] * self.scale * RESIZE_RATIO)
|
||||||
|
return scaled_size[0] >= MIN_SIZE and scaled_size[1] >= MIN_SIZE
|
||||||
|
return False
|
||||||
|
|
||||||
def zoom_in(self):
|
def zoom_in(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user