react-native-rectangle-doc-scanner 3.11.0 → 3.12.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.11.0",
3
+ "version": "3.12.0",
4
4
  "description": "Native-backed document scanner for React Native with customizable overlays.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -16,14 +16,21 @@
16
16
  return self;
17
17
  }
18
18
 
19
- - (void)didMoveToWindow {
20
- [super didMoveToWindow];
21
- if (self.window && !_hasSetupCamera) {
22
- // Only setup camera once when view is added to window
19
+ - (void)layoutSubviews {
20
+ [super layoutSubviews];
21
+
22
+ // Setup camera after layout is complete and bounds are valid
23
+ if (!_hasSetupCamera && self.window && !CGRectIsEmpty(self.bounds)) {
24
+ NSLog(@"[DocumentScanner] Setting up camera with bounds: %@", NSStringFromCGRect(self.bounds));
23
25
  [self setupCameraView];
24
26
  [self start];
25
27
  _hasSetupCamera = YES;
26
- } else if (!self.window && _hasSetupCamera) {
28
+ }
29
+ }
30
+
31
+ - (void)didMoveToWindow {
32
+ [super didMoveToWindow];
33
+ if (!self.window && _hasSetupCamera) {
27
34
  // Stop camera when view is removed from window
28
35
  [self stop];
29
36
  }