react-native-rectangle-doc-scanner 0.70.0 → 0.71.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/dist/utils/overlay.js +2 -21
- package/package.json +1 -1
- package/src/utils/overlay.tsx +2 -21
package/dist/utils/overlay.js
CHANGED
|
@@ -73,27 +73,8 @@ const Overlay = ({ quad, color = '#e7a649', frameSize, showGrid = true, gridColo
|
|
|
73
73
|
sourceQuad = quad;
|
|
74
74
|
}
|
|
75
75
|
else {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const marginY = screenHeight * marginRatio;
|
|
79
|
-
const maxWidth = screenWidth - marginX * 2;
|
|
80
|
-
const maxHeight = screenHeight - marginY * 2;
|
|
81
|
-
const a4Ratio = Math.SQRT2; // ~1.414 height / width
|
|
82
|
-
let width = maxWidth;
|
|
83
|
-
let height = width * a4Ratio;
|
|
84
|
-
if (height > maxHeight) {
|
|
85
|
-
height = maxHeight;
|
|
86
|
-
width = height / a4Ratio;
|
|
87
|
-
}
|
|
88
|
-
const left = (screenWidth - width) / 2;
|
|
89
|
-
const top = (screenHeight - height) / 2;
|
|
90
|
-
transformedQuad = [
|
|
91
|
-
{ x: left, y: top },
|
|
92
|
-
{ x: left + width, y: top },
|
|
93
|
-
{ x: left + width, y: top + height },
|
|
94
|
-
{ x: left, y: top + height },
|
|
95
|
-
];
|
|
96
|
-
sourceFrameSize = null;
|
|
76
|
+
// No detection yet – skip drawing
|
|
77
|
+
return { outlinePath: null, gridPaths: [] };
|
|
97
78
|
}
|
|
98
79
|
if (sourceQuad && sourceFrameSize) {
|
|
99
80
|
if (__DEV__) {
|
package/package.json
CHANGED
package/src/utils/overlay.tsx
CHANGED
|
@@ -66,27 +66,8 @@ export const Overlay: React.FC<OverlayProps> = ({
|
|
|
66
66
|
if (quad && frameSize) {
|
|
67
67
|
sourceQuad = quad;
|
|
68
68
|
} else {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const marginY = screenHeight * marginRatio;
|
|
72
|
-
const maxWidth = screenWidth - marginX * 2;
|
|
73
|
-
const maxHeight = screenHeight - marginY * 2;
|
|
74
|
-
const a4Ratio = Math.SQRT2; // ~1.414 height / width
|
|
75
|
-
let width = maxWidth;
|
|
76
|
-
let height = width * a4Ratio;
|
|
77
|
-
if (height > maxHeight) {
|
|
78
|
-
height = maxHeight;
|
|
79
|
-
width = height / a4Ratio;
|
|
80
|
-
}
|
|
81
|
-
const left = (screenWidth - width) / 2;
|
|
82
|
-
const top = (screenHeight - height) / 2;
|
|
83
|
-
transformedQuad = [
|
|
84
|
-
{ x: left, y: top },
|
|
85
|
-
{ x: left + width, y: top },
|
|
86
|
-
{ x: left + width, y: top + height },
|
|
87
|
-
{ x: left, y: top + height },
|
|
88
|
-
];
|
|
89
|
-
sourceFrameSize = null;
|
|
69
|
+
// No detection yet – skip drawing
|
|
70
|
+
return { outlinePath: null, gridPaths: [] };
|
|
90
71
|
}
|
|
91
72
|
|
|
92
73
|
if (sourceQuad && sourceFrameSize) {
|