fix ZeroDivisionError

bzr-revno: 1875
This commit is contained in:
Andreas Preikschat 2012-02-05 16:22:21 +01:00
commit f9fb2bea5b

View File

@ -82,8 +82,11 @@ class SlideController(Controller):
"""
Controller.__init__(self, parent, isLive)
self.screens = ScreenList.get_instance()
try:
self.ratio = float(self.screens.current[u'size'].width()) / \
float(self.screens.current[u'size'].height())
except ZeroDivisionError:
self.ratio = 1
self.imageManager = self.parent().imageManager
self.mediaController = self.parent().mediaController
self.loopList = [
@ -630,8 +633,11 @@ class SlideController(Controller):
if self.isLive:
self.__addActionsToWidget(self.display)
# The SlidePreview's ratio.
try:
self.ratio = float(self.screens.current[u'size'].width()) / \
float(self.screens.current[u'size'].height())
except ZeroDivisionError:
self.ratio = 1
self.mediaController.setup_display(self.display)
self.previewSizeChanged()
self.previewDisplay.setup()