react-native-rectangle-doc-scanner 3.15.0 → 3.16.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.15.0",
3
+ "version": "3.16.0",
4
4
  "description": "Native-backed document scanner for React Native with customizable overlays.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -220,15 +220,15 @@
220
220
  }
221
221
  }
222
222
 
223
- if (self.context && _coreImageContext)
223
+ if (self.context && _coreImageContext && _glkView)
224
224
  {
225
225
  // Calculate the rect to draw the image with aspect fill
226
- CGRect drawRect = self.bounds;
226
+ CGRect viewBounds = _glkView.bounds;
227
227
  CGRect imageExtent = image.extent;
228
228
 
229
229
  // Calculate aspect ratios
230
230
  CGFloat imageAspect = imageExtent.size.width / imageExtent.size.height;
231
- CGFloat viewAspect = drawRect.size.width / drawRect.size.height;
231
+ CGFloat viewAspect = viewBounds.size.width / viewBounds.size.height;
232
232
 
233
233
  CGRect fromRect = imageExtent;
234
234
 
@@ -245,6 +245,12 @@
245
245
  fromRect = CGRectMake(0, yOffset, imageExtent.size.width, newHeight);
246
246
  }
247
247
 
248
+ // GLKView renderbuffer expects pixel dimensions, not point-based bounds
249
+ CGRect drawRect = CGRectMake(0,
250
+ 0,
251
+ (CGFloat)_glkView.drawableWidth,
252
+ (CGFloat)_glkView.drawableHeight);
253
+
248
254
  [_coreImageContext drawImage:image inRect:drawRect fromRect:fromRect];
249
255
  [self.context presentRenderbuffer:GL_RENDERBUFFER];
250
256