forked from openlp/openlp
fix ZeroDivisionError
This commit is contained in:
parent
971b1fd45f
commit
bedb2d833d
@ -82,8 +82,11 @@ class SlideController(Controller):
|
|||||||
"""
|
"""
|
||||||
Controller.__init__(self, parent, isLive)
|
Controller.__init__(self, parent, isLive)
|
||||||
self.screens = ScreenList.get_instance()
|
self.screens = ScreenList.get_instance()
|
||||||
self.ratio = float(self.screens.current[u'size'].width()) / \
|
try:
|
||||||
float(self.screens.current[u'size'].height())
|
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.imageManager = self.parent().imageManager
|
||||||
self.mediaController = self.parent().mediaController
|
self.mediaController = self.parent().mediaController
|
||||||
self.loopList = [
|
self.loopList = [
|
||||||
@ -630,8 +633,11 @@ class SlideController(Controller):
|
|||||||
if self.isLive:
|
if self.isLive:
|
||||||
self.__addActionsToWidget(self.display)
|
self.__addActionsToWidget(self.display)
|
||||||
# The SlidePreview's ratio.
|
# The SlidePreview's ratio.
|
||||||
self.ratio = float(self.screens.current[u'size'].width()) / \
|
try:
|
||||||
float(self.screens.current[u'size'].height())
|
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.mediaController.setup_display(self.display)
|
||||||
self.previewSizeChanged()
|
self.previewSizeChanged()
|
||||||
self.previewDisplay.setup()
|
self.previewDisplay.setup()
|
||||||
|
Loading…
Reference in New Issue
Block a user