react-native-rectangle-doc-scanner 3.7.0 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-rectangle-doc-scanner",
3
- "version": "3.7.0",
3
+ "version": "3.8.0",
4
4
  "description": "Native-backed document scanner for React Native with customizable overlays.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -15,9 +15,13 @@
15
15
 
16
16
  - (void)didMoveToWindow {
17
17
  [super didMoveToWindow];
18
- if (self.window) {
18
+ if (self.window && !self.captureSession) {
19
+ // Only setup camera once when view is added to window
19
20
  [self setupCameraView];
20
21
  [self start];
22
+ } else if (!self.window && self.captureSession) {
23
+ // Stop camera when view is removed from window
24
+ [self stop];
21
25
  }
22
26
  }
23
27
 
@@ -70,6 +70,16 @@
70
70
  [[NSNotificationCenter defaultCenter] removeObserver:self];
71
71
  }
72
72
 
73
+ - (void)layoutSubviews
74
+ {
75
+ [super layoutSubviews];
76
+
77
+ // Update GLKView frame to match parent bounds
78
+ if (_glkView) {
79
+ _glkView.frame = self.bounds;
80
+ }
81
+ }
82
+
73
83
  - (void)createGLKView
74
84
  {
75
85
  if (self.context) return;