Skip to content
This repository was archived by the owner on Nov 14, 2023. It is now read-only.

Commit

Permalink
Update preview_kivycamera.py
Browse files Browse the repository at this point in the history
RobertFlatt committed Sep 9, 2022
1 parent 4f7cbca commit a41b111
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/camera4kivy/preview_kivycamera.py
Original file line number Diff line number Diff line change
@@ -31,12 +31,16 @@ def __init__(self, **kwargs):
self.cg_zoom_level = [1 , 1]
self.window_width = Window.width
if platform == 'ios':
app = App.get_running_app()
app.bind(on_resume = self.on_resume)
self._enable_on_resume()

def __del__(self):
self.disconnect_camera()

@mainthread
def _enable_on_resume(self):
app = App.get_running_app()
app.bind(on_resume = self.on_resume)

def on_resume(self, arg):
Window.update_viewport()

0 comments on commit a41b111

Please sign in to comment.