From 2ef23120a688b8cc7c994e5785144960dbc323f3 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 30 Jun 2021 19:37:33 +0800 Subject: [PATCH] bugfix --- kivyblocks/custom_camera.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/kivyblocks/custom_camera.py b/kivyblocks/custom_camera.py index 30f7766..862a916 100644 --- a/kivyblocks/custom_camera.py +++ b/kivyblocks/custom_camera.py @@ -35,6 +35,9 @@ class CustomCamera(XCamera): if self.isAndroid: self.angle = -90 + def set_angle(self, angle): + self.angle = -90 + def change_index(self, *args): new_index = 1 if self.index == 0 else 0 self._camera._set_index(new_index) @@ -69,6 +72,11 @@ class QrReader(XCamera): self.qr_result = None Logger.info('QrReader:Initialed') + def set_angle(self, *args, **kwargs): + print('kwargs=', kwargs) + angle = kwargs.get('angle', 0) + self.angle = angle + def getValue(self): return { "qr_result":self.qr_result @@ -88,7 +96,7 @@ class QrReader(XCamera): super(QrReader, self).on_tex(self.texture) def dismiss(self, *args, **kw): - self.release() + self.play = False cv2.destroyAllWindows() Builder.load_string(btxt)